Пример #1
0
 private function _createNewModelFolder(\GO\Base\Db\ActiveRecord $model)
 {
     GO::debug("Create new model folder " . $model->className() . "(ID:" . $model->id . ")");
     $folder = \GO\Files\Model\Folder::model()->findByPath($model->buildFilesPath(), true, array('acl_id' => $model->findAclId(), 'readonly' => 1));
     if (!$folder) {
         throw new \Exception("Failed to create folder " . $model->buildFilesPath());
     }
     //      if (!empty($model->acl_id))
     //          $folder->acl_id = $model->acl_id;
     $folder->acl_id = $model->findAclId();
     $folder->visible = 0;
     $folder->readonly = 1;
     $folder->systemSave = true;
     $folder->save(true);
     return $folder->id;
 }