Open Monograph Press  3.3.0
APP\Services\ContextService Class Reference
Inheritance diagram for APP\Services\ContextService:
PKP\Services\PKPContextService

Public Member Functions

 __construct ()
 
 afterDeleteContext ($hookName, $args)
 
 afterEditContext ($hookName, $args)
 
 beforeDeleteContext ($hookName, $args)
 
 resizeCoverThumbnails ($context, $maxWidth, $maxHeight)
 
 validateContext ($hookName, $args)
 
- Public Member Functions inherited from PKP\Services\PKPContextService
 add ($context, $request)
 
 delete ($context)
 
 edit ($context, $params, $request)
 
 get ($contextId)
 
 getCount ($args=[])
 
 getFullProperties ($context, $args=null)
 
 getIds ($args=[])
 
 getMany ($args=array())
 
 getManySummary ($args=[])
 
 getMax ($args=array())
 
 getProperties ($context, $props, $args=null)
 
 getQueryBuilder ($args=array())
 
 getSummaryProperties ($context, $args=null)
 
 moveTemporaryFile ($context, $temporaryFile, $fileNameBase, $userId, $localeKey='')
 
 restoreLocaleDefaults ($context, $request, $locale)
 
 validate ($action, $props, $allowedLocales, $primaryLocale)
 

Data Fields

 $contextsFileDirName = 'presses'
 
- Data Fields inherited from PKP\Services\PKPContextService
 $contextsFileDirName
 
 $installFileDirs
 

Additional Inherited Members

- Protected Member Functions inherited from PKP\Services\PKPContextService
 _saveFileParam ($context, $value, $settingName, $userId, $localeKey='', $isImage=false)
 

Detailed Description

Definition at line 19 of file ContextService.inc.php.

Constructor & Destructor Documentation

◆ __construct()

APP\Services\ContextService::__construct ( )

Initialize hooks for extending PKPContextService

Definition at line 26 of file ContextService.inc.php.

References Config\getVar(), and HookRegistry\register().

Member Function Documentation

◆ afterDeleteContext()

APP\Services\ContextService::afterDeleteContext (   $hookName,
  $args 
)

Perform additional actions after a context has been deleted

Parameters
$hookNamestring
$argsarray [ @option Context The new context @option Request ]

Definition at line 125 of file ContextService.inc.php.

References DAORegistry\getDAO().

◆ afterEditContext()

APP\Services\ContextService::afterEditContext (   $hookName,
  $args 
)

Update press-specific settings when a context is edited

Parameters
$hookNamestring
$argsarray [ @option Press The new context @option Press The current context @option array The params to edit @option Request ]

Definition at line 50 of file ContextService.inc.php.

References PKP\Services\PKPContextService\_saveFileParam(), and APP\Services\ContextService\resizeCoverThumbnails().

◆ beforeDeleteContext()

APP\Services\ContextService::beforeDeleteContext (   $hookName,
  $args 
)

Perform actions before a context has been deleted

This should only be used in cases where you need the context to still exist in the database to complete the actions. Otherwise, use ContextService::afterDeleteContext().

Parameters
$hookNamestring
$argsarray [ @option Context The new context @option Request ]

Definition at line 107 of file ContextService.inc.php.

◆ resizeCoverThumbnails()

APP\Services\ContextService::resizeCoverThumbnails (   $context,
  $maxWidth,
  $maxHeight 
)

Resize cover image thumbnails

Processes all cover images to resize the thumbnails according to the passed width and height maximums.

Parameters
$contextContext
$maxWidthint The maximum width allowed for a cover image
$maxHeightint The maximum width allowed for a cover image

Definition at line 175 of file ContextService.inc.php.

References PKPServices\get(), and DAORegistry\getDAO().

Referenced by APP\Services\ContextService\afterEditContext().

◆ validateContext()

APP\Services\ContextService::validateContext (   $hookName,
  $args 
)

Make additional validation checks

Parameters
$hookNamestring
$argsarray [ @option Context The new context @option Request ]

Definition at line 154 of file ContextService.inc.php.

References DAORegistry\getDAO().

Field Documentation

◆ $contextsFileDirName

APP\Services\ContextService::$contextsFileDirName = 'presses'

The file directory where context files are stored. Expects journals or presses.

Definition at line 21 of file ContextService.inc.php.


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