Beispiel #1
0
 public function save()
 {
     $data = array();
     if ($this->name != null) {
         $data['name'] = $this->name;
     }
     if ($this->description != null) {
         $data['description'] = $this->description;
     }
     if ($this->time_start != null) {
         $data['time_start'] = $this->time_start;
     }
     if ($this->time_end != null) {
         $data['time_end'] = $this->time_end;
     }
     if (!is_null($this->active)) {
         if ($this->active) {
             $data['active'] = Knowledgeroot_Db::true();
         } else {
             $data['active'] = Knowledgeroot_Db::false();
         }
     }
     // set changed_by
     if ($this->created_by === null) {
         $this->created_by = $session->id !== null ? $session->id : 0;
     }
     // set to guest user
     // set changed_by
     if ($this->changed_by === null) {
         $this->changed_by = $session->id !== null ? $session->id : 0;
     }
     // set to guest user
     if ($this->created_by !== null) {
         $data['created_by'] = $this->created_by;
     }
     if ($this->changed_by !== null) {
         $data['changed_by'] = $this->changed_by;
     }
     // create date object
     $date = new Knowledgeroot_Date();
     // set create date
     if ($this->create_date == null) {
         $this->create_date = $date->getDbDate();
         $data['create_date'] = $this->create_date;
     }
     // set last updated
     $this->change_date = $date->getDbDate();
     $data['change_date'] = $this->change_date;
     $group = new Knowledgeroot_Db_Group();
     if (is_null($this->id)) {
         $this->id = $group->insert($data);
     } else {
         $group->update($data, 'id = ' . $this->id);
     }
 }
Beispiel #2
0
 public function save()
 {
     if ($this->readOnly) {
         return;
     }
     $data = array();
     // get session
     $session = new Zend_Session_Namespace('user');
     if ($this->parent != null) {
         $data['parent'] = $this->parent;
     }
     if ($this->name != null) {
         $data['name'] = $this->name;
     }
     if ($this->content != null) {
         $data['content'] = $this->content;
     }
     if ($this->type != null) {
         $data['type'] = $this->type;
     }
     if ($this->sorting != null) {
         $data['sorting'] = $this->sorting;
     }
     if ($this->time_start != null) {
         $data['time_start'] = $this->time_start;
     }
     if ($this->time_end != null) {
         $data['time_end'] = $this->time_end;
     }
     if ($this->active != null) {
         $data['active'] = $this->active;
     }
     // set changed_by
     if ($this->created_by === null) {
         $this->created_by = $session->id !== null ? $session->id : 0;
     }
     // set to guest user
     // set changed_by
     if ($this->changed_by === null) {
         $this->changed_by = $session->id !== null ? $session->id : 0;
     }
     // set to guest user
     if ($this->created_by !== null) {
         $data['created_by'] = $this->created_by;
     }
     if ($this->changed_by !== null) {
         $data['changed_by'] = $this->changed_by;
     }
     // create date object
     $date = new Knowledgeroot_Date();
     // set create date
     if ($this->create_date == null) {
         $this->create_date = $date->getDbDate();
         $data['create_date'] = $this->create_date;
     }
     // set last updated
     $this->change_date = $date->getDbDate();
     $data['change_date'] = $this->change_date;
     $content = new Knowledgeroot_Db_Content();
     if ($this->id == null) {
         $this->id = $content->insert($data);
     } else {
         $content->update($data, 'id = ' . $this->id);
     }
     // check if acl is changed
     if ($this->acl !== null) {
         // get acl object
         $krAcl = Knowledgeroot_Registry::get('acl');
         // save acl
         $krAcl->saveAclForResource('content_' . $this->id, $this->acl);
     }
 }
Beispiel #3
0
 public function save()
 {
     $data = array();
     // get user session
     $session = new Zend_Session_Namespace('user');
     if ($this->name !== null) {
         $data['name'] = $this->name;
     }
     if ($this->subtitle !== null) {
         $data['subtitle'] = $this->subtitle;
     }
     if ($this->description !== null) {
         $data['description'] = $this->description;
     }
     if ($this->parent !== null) {
         $data['parent'] = $this->parent;
     }
     if ($this->tooltip !== null) {
         $data['tooltip'] = $this->tooltip;
     }
     if ($this->icon !== null) {
         $data['icon'] = $this->icon;
     }
     if ($this->alias !== null) {
         $data['alias'] = $this->alias;
     }
     if ($this->content_collapse == true) {
         $data['content_collapse'] = Knowledgeroot_Db::true();
     }
     if ($this->content_collapse == false) {
         $data['content_collapse'] = Knowledgeroot_Db::false();
     }
     if ($this->content_position != null) {
         $data['content_position'] = $this->content_position;
     }
     if ($this->show_content_description == true) {
         $data['show_content_description'] = Knowledgeroot_Db::true();
     }
     if ($this->show_content_description == false) {
         $data['show_content_description'] = Knowledgeroot_Db::false();
     }
     if ($this->show_table_of_content == true) {
         $data['show_table_of_content'] = Knowledgeroot_Db::true();
     }
     if ($this->show_table_of_content == false) {
         $data['show_table_of_content'] = Knowledgeroot_Db::false();
     }
     if ($this->sorting != null) {
         $data['sorting'] = $this->sorting;
     }
     if ($this->time_start != null) {
         $data['time_start'] = $this->time_start;
     }
     if ($this->time_end != null) {
         $data['time_end'] = $this->time_end;
     }
     if ($this->active != null) {
         $data['active'] = $this->active;
     }
     // set changed_by
     if ($this->created_by === null) {
         $this->created_by = $session->id !== null ? $session->id : 0;
     }
     // set to guest user
     // set changed_by
     if ($this->changed_by === null) {
         $this->changed_by = $session->id !== null ? $session->id : 0;
     }
     // set to guest user
     if ($this->created_by !== null) {
         $data['created_by'] = $this->created_by;
     }
     if ($this->changed_by !== null) {
         $data['changed_by'] = $this->changed_by;
     }
     // create date object
     $date = new Knowledgeroot_Date();
     // set create date
     if ($this->create_date == null) {
         $this->create_date = $date->getDbDate();
         $data['create_date'] = $this->create_date;
     }
     // set last updated
     $this->change_date = $date->getDbDate();
     $data['change_date'] = $this->change_date;
     $page = new Knowledgeroot_Db_Page();
     if ($this->id == null) {
         $this->id = $page->insert($data);
     } else {
         $page->update($data, 'id = ' . $this->id);
     }
     // check if acl is changed
     if ($this->acl !== null) {
         // get acl object
         $krAcl = Knowledgeroot_Registry::get('acl');
         // save acl
         $krAcl->saveAclForResource('page_' . $this->id, $this->acl);
     }
 }
Beispiel #4
0
 public function save()
 {
     $data = array();
     if ($this->first_name != null) {
         $data['first_name'] = $this->first_name;
     }
     if ($this->last_name != null) {
         $data['last_name'] = $this->last_name;
     }
     if ($this->login != null) {
         $data['login'] = $this->login;
     }
     if ($this->email != null) {
         $data['email'] = $this->email;
     }
     if ($this->passwordHash != null) {
         $data['password'] = $this->passwordHash;
     }
     if ($this->language != null) {
         $data['language'] = $this->language;
     }
     if ($this->timezone != null) {
         $data['timezone'] = $this->timezone;
     }
     if ($this->time_start != null) {
         $data['time_start'] = $this->time_start;
     }
     if ($this->time_end != null) {
         $data['time_end'] = $this->time_end;
     }
     if (!is_null($this->active)) {
         if ($this->active) {
             $data['active'] = Knowledgeroot_Db::true();
         } else {
             $data['active'] = Knowledgeroot_Db::false();
         }
     }
     // set changed_by
     if ($this->created_by === null) {
         $this->created_by = $session->id !== null ? $session->id : 0;
     }
     // set to guest user
     // set changed_by
     if ($this->changed_by === null) {
         $this->changed_by = $session->id !== null ? $session->id : 0;
     }
     // set to guest user
     if ($this->created_by !== null) {
         $data['created_by'] = $this->created_by;
     }
     if ($this->changed_by !== null) {
         $data['changed_by'] = $this->changed_by;
     }
     // create date object
     $date = new Knowledgeroot_Date();
     // set create date
     if ($this->create_date == null) {
         $this->create_date = $date->getDbDate();
         $data['create_date'] = $this->create_date;
     }
     // set last updated
     $this->change_date = $date->getDbDate();
     $data['change_date'] = $this->change_date;
     $user = new Knowledgeroot_Db_User();
     if (is_null($this->id)) {
         $this->id = $user->insert($data);
     } else {
         $user->update($data, 'id = ' . $this->id);
     }
 }
Beispiel #5
0
 public function save()
 {
     $data = array();
     // get session
     $session = new Zend_Session_Namespace('user');
     if ($this->parent != null) {
         $data['parent'] = $this->parent;
     }
     if ($this->name != null) {
         $data['name'] = $this->name;
     }
     if ($this->type != null) {
         $data['type'] = $this->type;
     }
     if ($this->size != null) {
         $data['size'] = $this->size;
     }
     if ($this->downloads != null) {
         $data['downloads'] = $this->downloads;
     }
     if ($this->hash != null) {
         $data['hash'] = $this->hash;
     }
     // set changed_by
     if ($this->created_by === null) {
         $this->created_by = $session->id !== null ? $session->id : 0;
     }
     // set to guest user
     // set changed_by
     if ($this->changed_by === null) {
         $this->changed_by = $session->id !== null ? $session->id : 0;
     }
     // set to guest user
     if ($this->created_by !== null) {
         $data['created_by'] = $this->created_by;
     }
     if ($this->changed_by !== null) {
         $data['changed_by'] = $this->changed_by;
     }
     // create date object
     $date = new Knowledgeroot_Date();
     // set create date
     if ($this->create_date == null) {
         $this->create_date = $date->getDbDate();
         $data['create_date'] = $this->create_date;
     }
     // set last updated
     $this->change_date = $date->getDbDate();
     $data['change_date'] = $this->change_date;
     $file = new Knowledgeroot_Db_File();
     if ($this->id == null) {
         $this->id = $file->insert($data);
     } else {
         $file->update($data, 'id = ' . $this->id);
     }
 }