예제 #1
0
 public function saveState(array &$params, $reflection = null)
 {
     parent::saveState($params, $reflection);
     if ($this->dir !== null) {
         $params['dirId'] = $this->dir->getId();
     }
     if ($this->file !== null) {
         $params['fileId'] = $this->file->getId();
     }
 }
예제 #2
0
파일: BaseFile.php 프로젝트: venne/files
 /**
  * @internal
  */
 public function generatePath()
 {
     if (!$this->isAllowedToWrite()) {
         throw new PermissionDeniedException();
     }
     $old = $this->path;
     if ($this->parent && $this->parent instanceof \Doctrine\ORM\Proxy\Proxy) {
         $this->parent->__load();
     }
     $this->path = ($this->parent ? $this->parent->path . '/' : '') . Strings::webalize($this->name, '.', false);
     if ($this->path == $old) {
         return;
     }
     if ($this->id) {
         if (!$this->oldPath && $old != $this->path) {
             $this->oldPath = $old;
         } elseif ($this->oldPath && $this->oldPath == $this->path) {
             $this->oldPath = null;
         }
     }
 }