PHP 클래스 Newscoop\Service\Implementation\ThemeServiceLocalFileSystem

상속: implements Newscoop\Service\IThemeService
파일 보기 프로젝트 열기: sourcefabric/newscoop 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$themeConfigFileName string
$themesFolder string

보호된 프로퍼티들

프로퍼티 타입 설명
$cacheThemeConfigs array
$cacheXMLEmelemt array
$errorHandler Newscoop\Service\IErrorHandler
$id Newscoop\Service\Resource\ResourceId

공개 메소드들

메소드 설명
__construct ( ResourceId $id ) Construct the service based on the provided resource id.
findById ( $id )
getById ( $id ) * ---------------------------------------------------------------
getCount ( Search $search = NULL )
getEntities ( Search $search = NULL, $offset, $limit )
getPresentationImages ( Theme $theme ) * ---------------------------------------------------------------
toFullPath ( Theme | string $theme, string $file = '' ) : string Provides the full path for a theme.

보호된 메소드들

메소드 설명
escapePath ( string $path ) : string Converts the provided path from the OS specific form (if is the cae) to using just forward slashes.
extractRelativePathFrom ( string $path ) : string Extracts from a provided file path the path where that file is located, attention the path needs to be in the escaped form.
filterThemes ( SearchTheme $search, array $themes ) : array Filters the provided array of themes based on the search.
findAllThemesConfigPaths ( ) : array Finds all paths to the configurations XML files for themes, that are located in the theme folder.
getErrorHandler ( ) : Newscoop\Service\IErrorHandler Provides the error handler.
getNodes ( SimpleXMLElement $node, string $tagName, string $attribute = NULL, $value = '' ) : array Finds all the childrens from the provided node that have the provided tag name
getResourceId ( ) : Newscoop\Services\Resource\ResourceId Provides the resource id.
loadTheme ( SimpleXMLElement $nodeTheme, string $id, string $themeConfig ) : Theme Loads the theme object.
loadThemeByPath ( str $themePath ) : Theme Load the theme from the provided relative path.
loadThemes ( array $themesConfigs ) : array Loads the provided theme configuration files.
loadXML ( string $path ) : SimpleXMLElement Loads the XML content into SimpleXMLElement.
readAttribute ( SimpleXMLElement $node, string $attribute ) : string Convienient method for read an attribute from a node.
sort ( array $array, string $property, $ascending ) : array Sort the array.
trim ( array $array, integer $offset, integer $limit ) : array Trims the array based on the offset and limit.

메소드 상세

__construct() 공개 메소드

Construct the service based on the provided resource id.
public __construct ( ResourceId $id )
$id Newscoop\Service\Resource\ResourceId The resource id, not null not empty

escapePath() 보호된 메소드

Converts the provided path from the OS specific form (if is the cae) to using just forward slashes.
protected escapePath ( string $path ) : string
$path string The path, *(not null not empty).
리턴 string The escaped path.

extractRelativePathFrom() 보호된 메소드

Extracts from a provided file path the path where that file is located, attention the path needs to be in the escaped form.
protected extractRelativePathFrom ( string $path ) : string
$path string The path from which to extract the relative path, *(not null not empty).
리턴 string The relative path for the provided path, not null.

filterThemes() 보호된 메소드

Filters the provided array of themes based on the search.
protected filterThemes ( SearchTheme $search, array $themes ) : array
$search Newscoop\Service\Model\SearchTheme The search to filter the themes by, *(not null not empty).
$themes array The array of Theme objects to be filtered, *(not null not empty).
리턴 array The array containing all themes that respect the search.

findAllThemesConfigPaths() 보호된 메소드

Finds all paths to the configurations XML files for themes, that are located in the theme folder.
protected findAllThemesConfigPaths ( ) : array
리턴 array The array containing as key the id of the theme config and as a value the relative path of the theme configuration XML file in escaped form. The id of a theme is formed based on the publication path with the crec32 applied.

findById() 공개 메소드

public findById ( $id )

getById() 공개 메소드

* ---------------------------------------------------------------
public getById ( $id )

getCount() 공개 메소드

public getCount ( Search $search = NULL )
$search Newscoop\Service\Model\Search\Search

getEntities() 공개 메소드

public getEntities ( Search $search = NULL, $offset, $limit )
$search Newscoop\Service\Model\Search\Search

getErrorHandler() 보호된 메소드

Provides the error handler.
protected getErrorHandler ( ) : Newscoop\Service\IErrorHandler
리턴 Newscoop\Service\IErrorHandler The error handler to be used.

getNodes() 보호된 메소드

Finds all the childrens from the provided node that have the provided tag name
protected getNodes ( SimpleXMLElement $node, string $tagName, string $attribute = NULL, $value = '' ) : array
$node SimpleXMLElement The node in which to search the childrens, not null.
$tagName string The tag name for the childrens to find, not null.
$attribute string Optional attribute name to search the kids by, beside the tag name.
$value Optional but if $attribute is specified than specify also the value of the attribute to find by.
리턴 array an array containing all the found nodes, not null can be empty.

getPresentationImages() 공개 메소드

* ---------------------------------------------------------------
public getPresentationImages ( Theme $theme )
$theme Newscoop\Entity\Theme

getResourceId() 보호된 메소드

Provides the resource id.
protected getResourceId ( ) : Newscoop\Services\Resource\ResourceId
리턴 Newscoop\Services\Resource\ResourceId The resource id.

loadTheme() 보호된 메소드

Loads the theme object.
protected loadTheme ( SimpleXMLElement $nodeTheme, string $id, string $themeConfig ) : Theme
$nodeTheme SimpleXMLElement The node Theme XML element, *(not null not empty).
$id string The id of the loaded Theme, *(not null not empty).
$themeConfig string The path of the Theme XML file in order to extract the theme path, *(not null not empty).
리턴 Newscoop\Entity\Theme The loaded theme object, NULL if there was an issue.

loadThemeByPath() 보호된 메소드

Load the theme from the provided relative path.
protected loadThemeByPath ( str $themePath ) : Theme
$themePath str The theme relative path.
리턴 Newscoop\Entity\Theme The loaded theme.

loadThemes() 보호된 메소드

Loads the provided theme configuration files.
protected loadThemes ( array $themesConfigs ) : array
$themesConfigs array The array containing as key the ide of the theme config (index) and as a value the relative path of the theme configuration XML file, *(not null not empty).
리턴 array The array containing all the loaded themes.

loadXML() 보호된 메소드

Loads the XML content into SimpleXMLElement.
protected loadXML ( string $path ) : SimpleXMLElement
$path string The path to the XML file, *(not null not empty).
리턴 SimpleXMLElement The XML element, NULL if the XML is not valid.

readAttribute() 보호된 메소드

This method will throw an exception in case the attribute is not specified.
protected readAttribute ( SimpleXMLElement $node, string $attribute ) : string
$node SimpleXMLElement The node to read from, *(not null not empty).
$attribute string The attribute name, *(not null not empty).
리턴 string The attribute value, not null.

sort() 보호된 메소드

Sort the array.
protected sort ( array $array, string $property, $ascending ) : array
$array array The array of elements to be sorted.
$property string The method name that provides the sorting key.
리턴 array The sorted array.

toFullPath() 공개 메소드

Provides the full path for a theme.
public toFullPath ( Theme | string $theme, string $file = '' ) : string
$theme Newscoop\Entity\Theme | string The Theme or path, *(not null not empty).
$file string Optional a file to be appended to the path.
리턴 string The full path to the theme and file if is the case.

trim() 보호된 메소드

Trims the array based on the offset and limit.
protected trim ( array $array, integer $offset, integer $limit ) : array
$array array The array to be trimed, not null.
$offset integer The offset.
$limit integer The limit.
리턴 array The trimed array.

프로퍼티 상세

$cacheThemeConfigs 보호되어 있는 프로퍼티

protected array $cacheThemeConfigs
리턴 array

$cacheXMLEmelemt 보호되어 있는 프로퍼티

protected array $cacheXMLEmelemt
리턴 array

$errorHandler 보호되어 있는 프로퍼티

protected IErrorHandler,Newscoop\Service $errorHandler
리턴 Newscoop\Service\IErrorHandler

$id 보호되어 있는 프로퍼티

protected ResourceId,Newscoop\Service\Resource $id
리턴 Newscoop\Service\Resource\ResourceId

$themeConfigFileName 공개적으로 프로퍼티

public string $themeConfigFileName
리턴 string

$themesFolder 공개적으로 프로퍼티

public string $themesFolder
리턴 string