public function approve() { foreach ($this->file->getFileVersions() as $fv) { $fv->fvIsApproved = false; $fv->save(false); } $this->fvIsApproved = true; $this->save(); $fe = new \Concrete\Core\File\Event\FileVersion($this); Events::dispatch('on_file_version_approve', $fe); $fo = $this->getFile(); $fo->reindex(); }
public function approve() { foreach ($this->file->getFileVersions() as $fv) { $fv->fvIsApproved = false; $fv->save(false); } $this->fvIsApproved = true; $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()); }
/** * {@inheritDoc} */ public function getFileVersions() { $this->__initializer__ && $this->__initializer__->__invoke($this, 'getFileVersions', array()); return parent::getFileVersions(); }
/** * @return \Concrete\Core\File\Version[] */ public function getFileVersions() { return parent::getFileVersions(); }