Pimcore\Model\Property\Predefined::getById PHP Метод

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

public static getById ( integer $id ) : self
$id integer
Результат self
    public static function getById($id)
    {
        try {
            $property = new self();
            $property->setId($id);
            $property->getDao()->getById();
        } catch (\Exception $e) {
            return null;
        }
        return $property;
    }

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->fetchCol("SELECT id FROM properties_predefined" . $this->getCondition() . $this->getOrder() . $this->getOffsetLimit(), $this->model->getConditionVariables());
     foreach ($propertiesData as $propertyData) {
         $properties[] = Property\Predefined::getById($propertyData);
     }
     $this->model->setProperties($properties);
     return $properties;
 }
All Usage Examples Of Pimcore\Model\Property\Predefined::getById