Exemplo n.º 1
0
 protected function initializeData()
 {
     $this->attachedModel = AttachedObject::loadById($this->attachedId, array('OBJECT.STORAGE', 'VERSION'));
     if (!$this->attachedModel) {
         $this->errorCollection->add(array(new Error(Loc::getMessage('DISK_UF_DOCUMENT_CONTROLLER_ERROR_COULD_NOT_FIND_ATTACHED_OBJECT'), self::ERROR_COULD_NOT_FIND_ATTACHED_OBJECT)));
         $this->sendJsonErrorResponse();
     }
     $this->fileId = $this->attachedModel->getObjectId();
     $this->file = $this->attachedModel->getFile();
     if ($this->attachedModel->getVersionId()) {
         $this->versionId = $this->attachedModel->getVersionId();
         $this->version = $this->attachedModel->getVersion();
     }
 }