Example #1
0
 public function approve()
 {
     foreach ($this->file->getFileVersions() as $fv) {
         $fv->fvIsApproved = false;
         $fv->save(false);
     }
     $this->fvIsApproved = true;
     $uID = (int) (new User())->getUserID();
     if ($uID !== 0) {
         $this->fvApproverUID = $uID;
     }
     $this->save();
     $fe = new \Concrete\Core\File\Event\FileVersion($this);
     Events::dispatch('on_file_version_approve', $fe);
     $fo = $this->getFile();
     $fo->reindex();
     \Core::make('cache/request')->delete('file/version/approved/' . $this->getFileID());
 }