Skip to content
This repository has been archived by the owner on Sep 10, 2021. It is now read-only.

Commit

Permalink
uploadGeneratetoken:: Fix style
Browse files Browse the repository at this point in the history
  • Loading branch information
jcfr committed Oct 27, 2015
1 parent 25fbe4b commit 1fe3c0a
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions core/controllers/components/ApisystemComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -408,23 +408,23 @@ public function uploadGeneratetoken($args)
MIDAS_POLICY_READ
)
) {
$create_additional_revision = isset($args['create_additional_revision']) ? $args['create_additional_revision'] : false;
$createAdditionalRevision = isset($args['create_additional_revision']) ? $args['create_additional_revision'] : false;
$revision = $itemModel->getLastRevision($item);

// do not create an additional revision if last revision has one bitstream and checkum matches
if ($create_additional_revision && $revision) {
// Do not create an additional revision if last revision has one bitstream and checksum matches.
if ($createAdditionalRevision && $revision) {
$bitstreams = $revision->getBitstreams();
if (count($bitstreams) == 1 && $args['checksum'] == $bitstreams[0]->getChecksum()) {
if (count($bitstreams) === 1 && $args['checksum'] == $bitstreams[0]->getChecksum()) {
return array('token' => '');
}
}

if ($revision === false || $create_additional_revision) {
// Create new revision if none exists yet or if the user explicitly asked for creating a new revision when
if ($revision === false || $createAdditionalRevision) {
// Create a new revision if none exists yet or if the user explicitly asks to create a new revision when
// a bitstream with the same checksum was found.
Zend_Loader::loadClass('ItemRevisionDao', BASE_PATH.'/core/models/dao');
$revision = new ItemRevisionDao();
if($create_additional_revision === false) {
if ($createAdditionalRevision === false) {
$revision->setChanges('Initial revision');
}
$revision->setUser_id($userDao->getKey());
Expand Down

0 comments on commit 1fe3c0a

Please sign in to comment.