Pimcore\Model\Object\KeyValue\KeyConfig::getById PHP Méthode

getById() public static méthode

public static getById ( integer $id ) : KeyConfig
$id integer
Résultat KeyConfig
    public static function getById($id)
    {
        try {
            $id = intval($id);
            if (self::$cacheEnabled && self::$cache[$id]) {
                return self::$cache[$id];
            }
            $config = new self();
            $config->setId($id);
            $config->getDao()->getById();
            if (self::$cacheEnabled) {
                self::$cache[$id] = $config;
            }
            return $config;
        } catch (\Exception $e) {
        }
    }

Usage Example

Exemple #1
0
 /**
  * Loads a list of keyvalue key configs for the specifies parameters, returns an array of config elements
  *
  * @return array
  */
 public function load()
 {
     $sql = "SELECT id FROM " . Object\KeyValue\KeyConfig\Dao::TABLE_NAME_KEYS . $this->getCondition() . $this->getOrder() . $this->getOffsetLimit();
     $configsData = $this->db->fetchCol($sql, $this->model->getConditionVariables());
     $configData = array();
     foreach ($configsData as $config) {
         $configData[] = Object\KeyValue\KeyConfig::getById($config);
     }
     $this->model->setList($configData);
     return $configData;
 }
All Usage Examples Of Pimcore\Model\Object\KeyValue\KeyConfig::getById