Property | Type | Description | |
---|---|---|---|
$themeConfigFileName | string | ||
$themesFolder | string |
Property | Type | Description | |
---|---|---|---|
$cacheThemeConfigs | array | ||
$cacheXMLEmelemt | array | ||
$errorHandler | Newscoop\Service\IErrorHandler | ||
$id |
Method | Description | |
---|---|---|
__construct ( |
Construct the service based on the provided resource id. | |
findById ( $id ) | ||
getById ( $id ) | * --------------------------------------------------------------- | |
getCount ( |
||
getEntities ( |
||
getPresentationImages ( |
* --------------------------------------------------------------- | |
toFullPath ( |
Provides the full path for a theme. |
Method | Description | |
---|---|---|
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 ( |
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 ) : |
Loads the theme object. | |
loadThemeByPath ( str $themePath ) : |
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. |
public __construct ( |
||
$id | The resource id, not null not empty |
protected escapePath ( string $path ) : string | ||
$path | string | The path, *(not null not empty). |
return | string | The escaped path. |
protected extractRelativePathFrom ( string $path ) : string | ||
$path | string | The path from which to extract the relative path, *(not null not empty). |
return | string | The relative path for the provided path, not null. |
protected filterThemes ( |
||
$search | 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). |
return | array | The array containing all themes that respect the search. |
protected findAllThemesConfigPaths ( ) : array | ||
return | 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. |
public getById ( $id ) |
public getCount ( |
||
$search |
public getEntities ( |
||
$search |
protected getErrorHandler ( ) : Newscoop\Service\IErrorHandler | ||
return | Newscoop\Service\IErrorHandler | The error handler to be used. |
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. | |
return | array | an array containing all the found nodes, not null can be empty. |
public getPresentationImages ( |
||
$theme |
protected getResourceId ( ) : Newscoop\Services\Resource\ResourceId | ||
return | Newscoop\Services\Resource\ResourceId | The resource id. |
protected loadTheme ( SimpleXMLElement $nodeTheme, string $id, string $themeConfig ) : |
||
$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). |
return | The loaded theme object, NULL if there was an issue. |
protected loadThemeByPath ( str $themePath ) : |
||
$themePath | str | The theme relative path. |
return | The loaded theme. |
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). |
return | array | The array containing all the loaded themes. |
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). |
return | string | The attribute value, not null. |
protected IErrorHandler,Newscoop\Service $errorHandler | ||
return | Newscoop\Service\IErrorHandler |
protected ResourceId,Newscoop\Service\Resource $id | ||
return |