/** * load custom data for $this->id * * @return void */ protected function loadCustomData() { parent::loadCustomData(); $d =& $this->data; $cd = DM\Files::getContentData($this->id); if (!empty($cd)) { $d['content_id'] = $cd['id']; $d['size'] = $cd['size']; $d['pages'] = $cd['pages']; $d['content_type'] = $cd['type']; $d['content_path'] = $cd['path']; $d['md5'] = $cd['md5']; } $this->data['versions'] = DM\FilesVersions::getFileVersions($this->id); }
public function deleteVersion($id) { $rez = array('success' => true, 'id' => $id); $content_id = 0; $version = DM\FilesVersions::read($id); if (!empty($version)) { $content_id = $version['content_id']; } DM\FilesVersions::delete($id); $this->removeContentId($content_id); DM\Tree::update(array('id' => $version['file_id'], 'updated' => 1)); Objects::updateCaseUpdateInfo($id); Solr\Client::runCron(); return $rez; }