Pimcore\Model\Asset\Video\Thumbnail\Config::getByName PHP Метод

getByName() публичный статический Метод

public static getByName ( $name ) : null | Config
$name
Результат null | Config
    public static function getByName($name)
    {
        $cacheKey = "videothumb_" . crc32($name);
        try {
            $thumbnail = \Zend_Registry::get($cacheKey);
            if (!$thumbnail) {
                throw new \Exception("Thumbnail in registry is null");
            }
        } catch (\Exception $e) {
            try {
                $thumbnail = new self();
                $thumbnail->getDao()->getByName($name);
                \Zend_Registry::set($cacheKey, $thumbnail);
            } catch (\Exception $e) {
                return null;
            }
        }
        return $thumbnail;
    }

Usage Example

Пример #1
0
 /**
  * Loads a list of predefined properties for the specicifies parameters, returns an array of Property\Predefined elements
  *
  * @return array
  */
 public function load()
 {
     $properties = array();
     $propertiesData = $this->db->fetchAll($this->model->getFilter(), $this->model->getOrder());
     foreach ($propertiesData as $propertyData) {
         $properties[] = Config::getByName($propertyData["id"]);
     }
     $this->model->setThumbnails($properties);
     return $properties;
 }
All Usage Examples Of Pimcore\Model\Asset\Video\Thumbnail\Config::getByName