Open Journal Systems  3.3.0
PKP\Services\PKPPublicationService Class Reference
Inheritance diagram for PKP\Services\PKPPublicationService:
APP\Services\PublicationService

Public Member Functions

 add ($publication, $request)
 
 delete ($publication)
 
 edit ($publication, $params, $request)
 
 get ($publicationId)
 
 getCount ($args=[])
 
 getDateBoundaries ($args)
 
 getFullProperties ($publication, $args=null)
 
 getIds ($args=[])
 
 getMany ($args=[])
 
 getMax ($args=[])
 
 getProperties ($publication, $props, $args=null)
 
 getQueryBuilder ($args=[])
 
 getSummaryProperties ($publication, $args=null)
 
 publish ($publication)
 
 unpublish ($publication)
 
 validate ($action, $props, $allowedLocales, $primaryLocale)
 
 validatePublish ($publication, $submission, $allowedLocales, $primaryLocale)
 
 version ($publication, $request)
 

Protected Member Functions

 _saveFileParam ($publication, $submission, $value, $settingName, $userId, $localeKey='', $isImage=false)
 

Detailed Description

Definition at line 32 of file PKPPublicationService.inc.php.

Member Function Documentation

◆ _saveFileParam()

PKP\Services\PKPPublicationService::_saveFileParam (   $publication,
  $submission,
  $value,
  $settingName,
  $userId,
  $localeKey = '',
  $isImage = false 
)
protected

Handle a publication setting for an uploaded file

  • Moves the temporary file to the public directory
  • Resets the param value to what is expected to be stored in the db
  • If a null value is passed, deletes any existing file

This method is protected because all operations which edit publications should go through the add and edit methods in order to ensure that the appropriate hooks are fired.

Parameters
Publication$publicationThe publication being edited
Submission$submissionThe submission this publication is part of
mixed$valueThe param value to be saved. Contains the temporary file ID if a new file has been uploaded.
string$settingNameThe name of the setting to save, typically used in the filename.
integer$userIdID of the user who owns the temporary file
string$localeKeyOptional. Pass if the setting is multilingual
boolean$isImageOptional. For image files which include alt text in value
Returns
string|array|null New param value or null on failure

Definition at line 700 of file PKPPublicationService.inc.php.

References PKPServices\get(), PKPApplication\get(), and Core\getCurrentDate().

◆ add()

PKP\Services\PKPPublicationService::add (   $publication,
  $request 
)

◆ delete()

PKP\Services\PKPPublicationService::delete (   $publication)

◆ edit()

PKP\Services\PKPPublicationService::edit (   $publication,
  $params,
  $request 
)

◆ get()

PKP\Services\PKPPublicationService::get (   $publicationId)

Definition at line 37 of file PKPPublicationService.inc.php.

References DAORegistry\getDAO().

◆ getCount()

PKP\Services\PKPPublicationService::getCount (   $args = [])

◆ getDateBoundaries()

PKP\Services\PKPPublicationService::getDateBoundaries (   $args)

Get the oldest and most recent published dates of matching publications

Parameters
array$argsSupports all args of self::getMany()
Returns
array [oldest, newest]

Definition at line 253 of file PKPPublicationService.inc.php.

References DAORegistry\getDAO(), and PKP\Services\PKPPublicationService\getQueryBuilder().

◆ getFullProperties()

PKP\Services\PKPPublicationService::getFullProperties (   $publication,
  $args = null 
)

◆ getIds()

PKP\Services\PKPPublicationService::getIds (   $args = [])

◆ getMany()

PKP\Services\PKPPublicationService::getMany (   $args = [])

Get publications

Parameters
array$args{ @option int|array submissionIds @option int count @option int offset }
Returns
Iterator

Definition at line 66 of file PKPPublicationService.inc.php.

References DAORegistry\getDAO(), and PKP\Services\PKPPublicationService\getQueryBuilder().

◆ getMax()

PKP\Services\PKPPublicationService::getMax (   $args = [])

◆ getProperties()

PKP\Services\PKPPublicationService::getProperties (   $publication,
  $props,
  $args = null 
)

◆ getQueryBuilder()

◆ getSummaryProperties()

PKP\Services\PKPPublicationService::getSummaryProperties (   $publication,
  $args = null 
)

◆ publish()

PKP\Services\PKPPublicationService::publish (   $publication)

◆ unpublish()

PKP\Services\PKPPublicationService::unpublish (   $publication)

◆ validate()

PKP\Services\PKPPublicationService::validate (   $action,
  $props,
  $allowedLocales,
  $primaryLocale 
)

◆ validatePublish()

PKP\Services\PKPPublicationService::validatePublish (   $publication,
  $submission,
  $allowedLocales,
  $primaryLocale 
)

Validate a publication against publishing requirements

This validation check should return zero errors before calling self::publish().

It should not be necessary to repeat validation rules from self::validate(). These rules should be applied during all add or edit actions.

This additional check should be used when a journal or press wants to enforce particular publishing requirements, such as requiring certain metadata or other information.

Parameters
Publication$publication
Submission$submission
array$allowedLocalesarray Which locales are allowed
string$primaryLocalestring
Returns
array List of error messages. The array keys are property names

Definition at line 382 of file PKPPublicationService.inc.php.

References HookRegistry\call().

◆ version()

PKP\Services\PKPPublicationService::version (   $publication,
  $request 
)

Create a new version of a publication

Make a copy of an existing publication, without the datePublished, and make copies of all associated objects.

Parameters
Publication$publicationThe publication to copy
Request
Returns
Publication The new publication

Definition at line 455 of file PKPPublicationService.inc.php.

References HookRegistry\call(), PKPServices\get(), PKPApplication\get(), DAORegistry\getDAO(), and SubmissionLog\logEvent().


The documentation for this class was generated from the following file: