public function getContent() { if (file_exists($this->getFilePath())) { return file_get_contents($this->getFilePath()); } else { return ''; } }
/** * Initiliaze from array * * @param array $array Data * * @return Model */ public static function fromArray(array $array) { $scriptTable = new Model(); $scriptTable->setData($array); $scriptTable->setOrigData(); if (empty($array['content'])) { $scriptTable->setContent($scriptTable->getContent()); } return $scriptTable; }