PHP Класс Newscoop\Service\Implementation\ThemeManagementServiceLocal

The implementation relays on the local structure, this means that this service will use also the file system and Doctrine for synchronizing with the database.
Наследование: extends ThemeServiceLocalFileSystem, implements Newscoop\Service\IThemeManagementService
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$articleTypeService Newscoop\Service\IArticleTypeService
$em Doctrine\ORM\EntityManager
$outputService Newscoop\Service\IOutputService
$outputSettingIssueService Newscoop\Service\IOutputSettingIssueService
$syncResourceService Newscoop\Service\ISyncResourceService

Открытые методы

Метод Описание
assignArticleTypes ( $articleTypes, Theme $theme ) : string Adds new mapping in the theme xml
assignOutputSetting ( OutputSettings $outputSettings, Theme $theme )
assignTheme ( Theme $theme, Publication $publication, $cli = false )
copyToUnassigned ( Theme $theme )
exportTheme ( $theme, $p_errorMsg = '' ) * ---------------------------------------------------------------
findOutputSetting ( Theme $theme, Output $output )
getArticleTypeService ( ) : Newscoop\Service\IArticleTypeService Provides the article type service.
getArticleTypes ( Theme $theme ) : object
getCountThemes ( $publication, SearchTheme $search = NULL )
getCountUnassignedThemes ( Search $search = NULL ) : integer Provides the count of the entities that can be associated with the provided search.
getOutputSettings ( Theme $theme )
getTemplates ( $theme )
getThemePublication ( Theme $theme, Output $output = null ) : Publication Get the publication of a theme, and optionally output
getThemes ( $publication, SearchTheme $search = NULL, $offset, $limit )
getUnassignedThemes ( SearchTheme $search = NULL, $offset, $limit )
installTheme ( $filePath )
removeTheme ( $theme )
updateTheme ( Theme $theme )

Защищенные методы

Метод Описание
copy ( string $src, string $dst ) Copies recursivelly the folder content from src to destination.
filterThemesConfigPathsInSameFolder ( string $config, array $allConfigs ) : array Filter from the provided configs array all the configs that are located under the same folder.
getManager ( ) : Doctrine\ORM\EntityManager Provides the dictrine entity manager.
getNewThemeFolder ( str $inFolder ) : str Provides a new folder (Automatically created) to place a new theme.
getOutputService ( ) : Newscoop\Service\IOutputService Provides the ouput service.
getOutputSettingIssueService ( ) : Newscoop\Service\IOutputSettingIssueService Provides the Output setting issue service.
getRelativePath ( Resource $rsc, string $themePath ) : string Provides the relative path of the resource based on the provided theme path.
getSyncResourceService ( ) : Newscoop\Service\ISyncResourceService Provides the sync resource service.
loadOutputResource ( SimpleXMLElement $parent, string $tagName, string $themePath ) : Resource Reads the resources from an output tag.
loadOutputSetting ( SimpleXMLElement $nodeOutput, string $themePath ) : OutputSettings Load the output setting from the provided xml node.
loadOutputSettings ( string $themePath ) : array Load all the output settings from the specified path.
rrmdir ( string $dir ) Deletes recursivelly the folder content from dir.
syncOutputSettings ( OutputSettings $to, OutputSettings $from ) Copies from the from output settings to the to output settings all the pages (front, article .

Приватные методы

Метод Описание
getThemesData ( $publication, SearchTheme $search = NULL )
getUnassignedThemesData ( SearchTheme $search = NULL ) * ---------------------------------------------------------------

Описание методов

assignArticleTypes() публичный Метод

Adds new mapping in the theme xml
public assignArticleTypes ( $articleTypes, Theme $theme ) : string
$articleTypes an array of mapping new values to old ones [ oldTypeName => [ name : newTypeName, ignore : boolean, fields' : [ OldFieldName : [ name : new/oldType, parentType : existingSysType, ignore : boolean ], [...] ] ] , [...] ] parentType => existingSysType will be used for getting it's other props from db
$theme Newscoop\Entity\Theme
Результат string the generated xml

assignOutputSetting() публичный Метод

public assignOutputSetting ( OutputSettings $outputSettings, Theme $theme )
$outputSettings Newscoop\Entity\OutputSettings
$theme Newscoop\Entity\Theme

assignTheme() публичный Метод

public assignTheme ( Theme $theme, Publication $publication, $cli = false )
$theme Newscoop\Entity\Theme
$publication Newscoop\Entity\Publication

copy() защищенный Метод

Copies recursivelly the folder content from src to destination.
protected copy ( string $src, string $dst )
$src string The source folder, *(not null not empty).
$dst string the destination folder, *(not null not empty).

copyToUnassigned() публичный Метод

public copyToUnassigned ( Theme $theme )
$theme Newscoop\Entity\Theme

exportTheme() публичный Метод

* ---------------------------------------------------------------
public exportTheme ( $theme, $p_errorMsg = '' )

filterThemesConfigPathsInSameFolder() защищенный Метод

For instance if the config is in a publication folder than this method will return all the configs for that publicatio.
protected filterThemesConfigPathsInSameFolder ( string $config, array $allConfigs ) : array
$config string The config path to be searched for, not null.
$allConfigs array
Результат array The array containing as key the id of the theme config (index) and as a value the relative path of the theme configuration XML file for all configurations that are iun the same folder, not null can be empty.

findOutputSetting() публичный Метод

public findOutputSetting ( Theme $theme, Output $output )
$theme Newscoop\Entity\Theme
$output Newscoop\Entity\Output

getArticleTypeService() публичный Метод

Provides the article type service.
public getArticleTypeService ( ) : Newscoop\Service\IArticleTypeService
Результат Newscoop\Service\IArticleTypeService

getArticleTypes() публичный Метод

Автор: mihaibalaceanu
public getArticleTypes ( Theme $theme ) : object
$theme Newscoop\Entity\Theme
Результат object

getCountThemes() публичный Метод

public getCountThemes ( $publication, SearchTheme $search = NULL )
$search Newscoop\Service\Model\SearchTheme

getCountUnassignedThemes() публичный Метод

Provides the count of the entities that can be associated with the provided search.
public getCountUnassignedThemes ( Search $search = NULL ) : integer
$search Newscoop\Service\Model\Search\Search The search criteria, not null.
Результат integer The entities count.

getManager() защищенный Метод

Provides the dictrine entity manager.
protected getManager ( ) : Doctrine\ORM\EntityManager
Результат Doctrine\ORM\EntityManager The doctrine entity manager.

getNewThemeFolder() защищенный Метод

Provides a new folder (Automatically created) to place a new theme.
protected getNewThemeFolder ( str $inFolder ) : str
$inFolder str The folder wehere to place the new theme folder, this has to be relative to the themes folder.
Результат str The relative theme path.

getOutputService() защищенный Метод

Provides the ouput service.
protected getOutputService ( ) : Newscoop\Service\IOutputService
Результат Newscoop\Service\IOutputService The service service to be used.

getOutputSettingIssueService() защищенный Метод

Provides the Output setting issue service.
protected getOutputSettingIssueService ( ) : Newscoop\Service\IOutputSettingIssueService
Результат Newscoop\Service\IOutputSettingIssueService The output setting issue service to be used by this controller.

getOutputSettings() публичный Метод

public getOutputSettings ( Theme $theme )
$theme Newscoop\Entity\Theme

getRelativePath() защищенный Метод

This method also checks if the resource path is compatible with the theme path meaning that the resource needs to be placed in the theme.
protected getRelativePath ( Resource $rsc, string $themePath ) : string
$rsc Newscoop\Entity\Resource The resource to extract the relative path from, not null.
$themePath string The theme path, not null.
Результат string The relative [path in regards with the theme path for the resource.

getSyncResourceService() защищенный Метод

Provides the sync resource service.
protected getSyncResourceService ( ) : Newscoop\Service\ISyncResourceService
Результат Newscoop\Service\ISyncResourceService The sync resource service to be used.

getTemplates() публичный Метод

public getTemplates ( $theme )

getThemePublication() публичный Метод

Get the publication of a theme, and optionally output
public getThemePublication ( Theme $theme, Output $output = null ) : Publication
$theme Newscoop\Entity\Theme
$output Newscoop\Entity\Output
Результат Newscoop\Entity\Publication

getThemes() публичный Метод

public getThemes ( $publication, SearchTheme $search = NULL, $offset, $limit )
$search Newscoop\Service\Model\SearchTheme

getUnassignedThemes() публичный Метод

public getUnassignedThemes ( SearchTheme $search = NULL, $offset, $limit )
$search Newscoop\Service\Model\SearchTheme

installTheme() публичный Метод

public installTheme ( $filePath )

loadOutputResource() защищенный Метод

Reads the resources from an output tag.
protected loadOutputResource ( SimpleXMLElement $parent, string $tagName, string $themePath ) : Resource
$parent SimpleXMLElement The parent output node to read the resources from, *(not null not empty).
$tagName string The tag name containing the resource, *(not null not empty).
$themePath string The theme path to construct the resource path based on, *(not null not empty).
Результат Newscoop\Entity\Resource The obtained resource, not null.

loadOutputSetting() защищенный Метод

Load the output setting from the provided xml node.
protected loadOutputSetting ( SimpleXMLElement $nodeOutput, string $themePath ) : OutputSettings
$nodeOutput SimpleXMLElement The node from which to load, *(not null not empty).
$themePath string The theme path to construct the resource path based on, *(not null not empty).
Результат Newscoop\Entity\OutputSettings The loaded output setting, not null.

loadOutputSettings() защищенный Метод

Load all the output settings from the specified path.
protected loadOutputSettings ( string $themePath ) : array
$themePath string The theme path from where to load the output settings, *(not null not empty).
Результат array The array containing all the found output settings, not null.

removeTheme() публичный Метод

public removeTheme ( $theme )

rrmdir() защищенный Метод

Deletes recursivelly the folder content from dir.
protected rrmdir ( string $dir )
$dir string The floder to be deleted, *(not null not empty).

syncOutputSettings() защищенный Метод

..).
protected syncOutputSettings ( OutputSettings $to, OutputSettings $from )
$to Newscoop\Entity\OutputSettings The output setting to copy to, *(not null not empty).
$from Newscoop\Entity\OutputSettings The output setting to copy from, *(not null not empty).

updateTheme() публичный Метод

public updateTheme ( Theme $theme )
$theme Newscoop\Entity\Theme

Описание свойств

$articleTypeService защищенное свойство

protected IArticleTypeService,Newscoop\Service $articleTypeService
Результат Newscoop\Service\IArticleTypeService

$em защищенное свойство

protected Doctrine\ORM\EntityManager $em
Результат Doctrine\ORM\EntityManager

$outputService защищенное свойство

protected IOutputService,Newscoop\Service $outputService
Результат Newscoop\Service\IOutputService

$outputSettingIssueService защищенное свойство

protected IOutputSettingIssueService,Newscoop\Service $outputSettingIssueService
Результат Newscoop\Service\IOutputSettingIssueService

$syncResourceService защищенное свойство

protected ISyncResourceService,Newscoop\Service $syncResourceService
Результат Newscoop\Service\ISyncResourceService