/**
  * @param SQL_TABLE $table
  * @param integer $action
  * @param STORABLE $obj
  * @access private
  */
 protected function _commit_table($table, $action, $obj)
 {
     parent::_commit_table($table, $action, $obj);
     if ($table->name == $obj->table_name() && $action == Storage_action_create) {
         $this->db->logged_query('SELECT id FROM ' . $obj->table_name() . ' ORDER BY id DESC LIMIT 1');
         // get the last record created
         $this->db->next_record();
         $obj->id = $this->db->f("id");
     }
 }
예제 #2
0
 /**
  * @param SQL_STORAGE $storage Store values to this object.
  * @access private
  */
 public function store_to($storage)
 {
     $tname = $this->app->table_names->user_permissions;
     $storage->restrict($tname, 'user_id');
     $storage->add($tname, 'user_id', Field_type_integer, $this->user_id, Storage_action_create);
     $this->global_privileges->store_to($storage, $tname);
     $this->allow_privileges->store_to($storage, $tname, 'allow_');
     $this->deny_privileges->store_to($storage, $tname, 'deny_');
     $this->_exists = true;
 }
예제 #3
0
 /**
  * @param SQL_STORAGE $storage Store values to this object.
  */
 public function store_to($storage)
 {
     $tname = $this->app->table_names->versions;
     $storage->add($tname, 'title', Field_type_string, $this->title);
     $storage->add($tname, 'version', Field_type_string, $this->database_version);
     $storage->restrict($tname, 'title');
 }
예제 #4
0
 /**
  * @param SQL_STORAGE $storage Store values to this object.
  */
 public function store_to($storage)
 {
     $tname = $this->app->table_names->folder_permissions;
     $storage->restrict($tname, 'kind');
     $storage->restrict($tname, 'folder_id');
     $storage->restrict($tname, 'ref_id');
     $storage->add($tname, 'kind', Field_type_string, $this->kind, Storage_action_create);
     $storage->add($tname, 'folder_id', Field_type_integer, $this->folder_id, Storage_action_create);
     $storage->add($tname, 'ref_id', Field_type_integer, $this->ref_id, Storage_action_create);
     $storage->add($tname, 'importance', Field_type_integer, $this->importance);
     $this->privileges->store_to($storage, $tname);
     $this->_exists = true;
 }
예제 #5
0
 /**
  * @param SQL_STORAGE $storage Store values to this object.
  */
 public function store_to($storage)
 {
     $tname = $this->table_name();
     $storage->restrict($tname, 'id');
     $storage->add($tname, 'id', Field_type_integer, $this->id, Storage_action_none);
 }
 /**
  * @param SQL_STORAGE $storage Store values to this object.
  */
 public function store_to($storage)
 {
     if ($this->_stores_data) {
         $table_name = $this->_settings_table_name();
         $storage->restrict($table_name, 'folder_id');
         $storage->add($table_name, 'folder_id', Field_type_integer, $this->_definer_id, Storage_action_create);
     }
     $this->_exists = true;
 }