public function __get($name) { if ($name === $this->attribute) { if ($this->_file === null) { $this->_file = UploadedFile::getInstance($this->owner, $this->attribute); } return $this->_file; } else { return parent::__get($name); } }