public function __get($attr) { if ($attr == 'hash' && empty($this->data['hash'])) { $this->hash = $this->hash(); } return parent::__get($attr); }