-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pkp/pkp-lib#2163 initial work for new entity properties list support
- Loading branch information
1 parent
6dc9da9
commit 6cebe21
Showing
6 changed files
with
278 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
/** | ||
* @file classes/services/AuthorService.php | ||
* | ||
* Copyright (c) 2014-2017 Simon Fraser University | ||
* Copyright (c) 2000-2017 John Willinsky | ||
* Distributed under the GNU GPL v2. For full terms see the file docs/COPYING. | ||
* | ||
* @class AuthorService | ||
* @ingroup services | ||
* | ||
* @brief Extends the base author helper service class with app-specific | ||
* requirements. | ||
*/ | ||
|
||
namespace OJS\Services; | ||
|
||
use \PKP\Services\PKPAuthorService; | ||
|
||
class AuthorService extends PKPAuthorService { | ||
|
||
/** | ||
* Constructor | ||
*/ | ||
public function __construct() { | ||
parent::__construct(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
<?php | ||
|
||
/** | ||
* @file classes/services/GalleyService.php | ||
* | ||
* Copyright (c) 2014-2017 Simon Fraser University | ||
* Copyright (c) 2000-2017 John Willinsky | ||
* Distributed under the GNU GPL v2. For full terms see the file docs/COPYING. | ||
* | ||
* @class GalleyService | ||
* @ingroup services | ||
* | ||
* @brief Helper class that encapsulates galley business logic | ||
*/ | ||
|
||
namespace OJS\Services; | ||
|
||
use \PKP\Services\EntityProperties\PKPBaseEntityPropertyService; | ||
|
||
class GalleyService implements PKPBaseEntityPropertyService { | ||
|
||
/** | ||
* Constructor | ||
*/ | ||
public function __construct() { | ||
parent::__construct($this); | ||
} | ||
|
||
/** | ||
* @copydoc \PKP\Services\EntityProperties\EntityPropertyInterface::getProperties() | ||
*/ | ||
public function getProperties($galley, $props, $args = null) { | ||
$values = array(); | ||
foreach ($props as $prop) { | ||
switch ($prop) { | ||
case 'id': | ||
$values[$prop] = $galley->getId(); | ||
break; | ||
case '_href': | ||
$values[$prop] = $galley->getId(); | ||
break; | ||
// case 'parent': | ||
// $values[$prop] = $galley->getId(); | ||
// break; | ||
case 'locale': | ||
$values[$prop] = $galley->getId(); | ||
break; | ||
case 'label': | ||
$values[$prop] = $galley->getName(null); | ||
break; | ||
case 'remoteUrl': | ||
$values[$prop] = $galley->getRemoteURL(); | ||
break; | ||
// case 'publishedUrl': | ||
// $values[$prop] = $galley->getId(); | ||
// break; | ||
case 'seq': | ||
case 'sequence': | ||
$values[$prop] = $galley->getSequence(); | ||
break; | ||
default: | ||
$this->getUnknownProperty($galley, $prop, $values); | ||
} | ||
} | ||
|
||
return $values; | ||
} | ||
|
||
/** | ||
* @copydoc \PKP\Services\EntityProperties\EntityPropertyInterface::getSummaryProperties() | ||
*/ | ||
public function getSummaryProperties($galley, $args = null) { | ||
$props = array ( | ||
'id','_href','parent','locale','label','seq','remoteUrl','publishedUrl' | ||
); | ||
$props = $this->getSummaryPropertyList($galley, $props); | ||
return $this->getProperties($galley, $props); | ||
} | ||
|
||
/** | ||
* @copydoc \PKP\Services\EntityProperties\EntityPropertyInterface::getFullProperties() | ||
*/ | ||
public function getFullProperties($galley, $args = null) { | ||
$props = array ( | ||
'id','_href','parent','locale','label','seq','remoteUrl','publishedUrl' | ||
); | ||
$props = $this->getFullPropertyList($galley, $props); | ||
return $this->getProperties($galley, $props); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.