Newscoop\Entity\Resource::setName PHP Метод

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

Set the name of the theme resource, must be a user frendly name used for displaying it on the UI.
public setName ( string $name ) : Newscoop\Entity\Resource
$name string The name of the theme resource, must not be null or empty.
Результат Newscoop\Entity\Resource This object for chaining purposes.
    function setName($name)
    {
        Validation::notEmpty($name, 'name');
        $this->name = $name;
        return $this;
    }

Usage Example

Пример #1
0
 public function __construct($p_templateIdOrName = null, $p_themePath = null)
 {
     $this->m_properties = array();
     $this->m_customProperties['name'] = 'getValue';
     $this->m_customProperties['identifier'] = 'getId';
     $this->m_customProperties['type'] = 'getTemplateType';
     $this->m_customProperties['defined'] = 'defined';
     $this->m_customProperties['theme_dir'] = 'getThemeDir';
     $this->_map = array("frontPage" => "issue", "errorPage" => "default", "sectionPage" => "section", "issuePage" => "issue", "articlePage" => "article");
     if ((is_string($p_templateIdOrName) || is_int($p_templateIdOrName)) && !empty($p_templateIdOrName)) {
         $filePath = is_numeric($p_templateIdOrName) ? $p_templateIdOrName : $p_themePath . $p_templateIdOrName;
         $resourceId = new ResourceId('template_engine/metaclasses/MetaTemplate');
         /* @var $syncResourceService ISyncResourceService */
         $syncResourceService = $resourceId->getService(ISyncResourceService::NAME);
         $this->m_dbObject = $syncResourceService->findByPathOrId($filePath);
         if (is_null($this->m_dbObject)) {
             $pathRsc = new Resource();
             $pathRsc->setName('buildPage');
             $filePath = CS_PATH_TEMPLATES . DIR_SEP . $p_themePath . $p_templateIdOrName;
             if (!is_numeric($p_templateIdOrName) && !is_null($p_themePath) && file_exists($filePath)) {
                 $pathRsc->setPath($p_themePath . $p_templateIdOrName);
                 $this->m_dbObject = $syncResourceService->getSynchronized($pathRsc);
             } else {
                 $this->m_dbObject = $pathRsc;
             }
         }
     }
 }
All Usage Examples Of Newscoop\Entity\Resource::setName