Whenever a property is accessed that doesn't actually exist, PHP calls the object's __get()
method. If your object is extending \Phalcon\Mvc\Model, you'll need to ensure you call parent::__get()
too. Something like:
public method __get($name){
if($name == 'arrKeysReversed'){
$keys = array_keys($this->arr);
rsort($keys);
return $keys;
}
else{
return parent::__get($name);
}
}