Пример #1
0
 /**
  * After loading the row from the database, ensure that the file exists and
  * that the two data points are up to date.
  */
 public function onAfterLoad()
 {
     $fs = new Filesystem();
     $path = $this->getFilePath();
     if (isset($path) && $fs->exists($path)) {
         $mtime = $fs->mtime($path);
         if ($mtime > $this->getModificationTime()) {
             $this->unserializeFileData($fs->read($path));
             $this->setModificationTime($mtime);
             $this->save();
         }
     }
 }