/** * Freezes an array * * @return void */ public function freeze() { if (!$this->isFrozen()) { $this->onFreeze($this); parent::freeze(); } }
/** * Locks this object for further changes * * @return void */ public function freeze() { parent::freeze(); if ($this->_og) { $this->_og->freeze(); } }
/** * Is property defined? * * @param string property name * * @return bool */ public function __isset($key) { return isset($this->data[$key]) || parent::__isset($key); }
parent::__get($key);}else{return$this->data[$key];}}function __isset($key){return isset($this->data[$key])||parent::__isset($key);}function
/** * Static Magic find. * - $col = Page::findByUrl('about-us'); * - $rec = Page::findByCategoryIdAndVisibility(5, TRUE); * - $rec = User::findByNameAndLogin('John', 'john007'); * - $rec = Product::findByCategory(3); * * @param string $name * @param array $args * @return ActiveCollection|ActiveRecord|NULL */ public static function __callStatic($name, $args) { if (strncmp($name, 'findBy', 6) === 0) { // single record //$method = 'find'; $name = substr($name, 6); } else { return parent::__callStatic($name, $args); } // ProductIdAndTitle -> array('productId', 'title') $parts = array_map('lcfirst', explode('And', $name)); if (count($parts) !== count($args)) { throw new \Nette\InvalidArgumentException("Magic find expects " . count($parts) . " parameters, but " . count($args) . " was given."); } return self::findBy(array_combine($parts, $args)); }