Exemple #1
0
 public function __get($property)
 {
     if ($this->offsetExists($property)) {
         return $this->_dataAccess[$property];
     }
     return parent::__get($property);
 }
Exemple #2
0
 /**
  * Magic method to use attribute in snake_case
  * For example $ex->a_method is same as $ex->getAMethod()
  * @param string $property The property in snake_case
  * @return mixed Call the method if it exists, otherwise call parent __get() method
  */
 public function __get($property)
 {
     $method = 'get' . Phalcon\Text::camelize($property);
     if (method_exists($this, $method)) {
         return $this->{$method}();
     }
     parent::__get($property);
 }