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;
}
/** * 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; }