Pimcore\Model\Document::setUserModification PHP Method

setUserModification() public method

Set id of the user last modified the document.
public setUserModification ( integer $userModification ) : Document
$userModification integer
return Document
    public function setUserModification($userModification)
    {
        $this->userModification = (int) $userModification;
        return $this;
    }

Usage Example

コード例 #1
0
 public function preDispatch()
 {
     parent::preDispatch();
     if ($this->getParam('ctype') === 'document') {
         $this->element = Document::getById((int) $this->getParam('cid', 0));
     } elseif ($this->getParam('ctype') === 'asset') {
         $this->element = Asset::getById((int) $this->getParam('cid', 0));
     } elseif ($this->getParam('ctype') === 'object') {
         $this->element = ConcreteObject::getById((int) $this->getParam('cid', 0));
     }
     if (!$this->element) {
         throw new \Exception('Cannot load element' . $this->getParam('cid') . ' of type \'' . $this->getParam('ctype') . '\'');
     }
     //get the latest available version of the element -
     //$this->element = $this->getLatestVersion($this->element);
     $this->element->setUserModification($this->getUser()->getId());
 }
All Usage Examples Of Pimcore\Model\Document::setUserModification