Gc\Script\Model::getContent PHP Method

getContent() public method

Return file contents
public getContent ( ) : string
return string
    public function getContent()
    {
        if (file_exists($this->getFilePath())) {
            return file_get_contents($this->getFilePath());
        } else {
            return '';
        }
    }

Usage Example

Beispiel #1
0
 /**
  * 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;
 }
All Usage Examples Of Gc\Script\Model::getContent