Пример #1
0
 /**
  * Handle special case for root folders.
  * If the folder has no parent (it's a root folder), then update its
  * permissions to point to itself. Does not create any permissions records by
  * default. If the folder has a parent, apply any subscriptions from the
  * parent to this new folder.
  * @access private
  */
 protected function _create()
 {
     parent::_create();
     $parent = $this->parent_folder();
     if (!isset($parent)) {
         $sec = $this->security_definition();
         $sec->set_inherited(false);
     } else {
         $subscriber_query = $parent->subscriber_query();
         /** @var SUBSCRIBER[] $objects */
         $objects = $subscriber_query->objects();
         foreach ($objects as $obj) {
             $obj->subscribe($this->id, Subscribe_folder);
         }
     }
 }
Пример #2
0
 /**
  * @access private
  */
 protected function _create()
 {
     $this->db->logged_query("SELECT MAX(number) FROM {$this->app->table_names->comments} WHERE entry_id = {$this->entry_id}");
     if ($this->db->next_record()) {
         $this->number = $this->db->f(0) + 1;
     } else {
         $this->number = 1;
     }
     parent::_create();
 }