Exemple #1
0
 /**
  * For all saves, write the template file with the new contents.
  *
  * Technically we could make this afterInsert and do more checks
  * in afterUpdate to make sure things actually changed, but this
  * is much simpler.
  */
 public function onAfterSave()
 {
     $fs = new Filesystem();
     $path = $this->getFilePath();
     if (isset($path) && $fs->exists($fs->dirname($path))) {
         $fs->write($path, $this->serializeFileData(), TRUE);
     }
 }