当前位置: 首页>>代码示例>>PHP>>正文


PHP SimpleORMap::store方法代码示例

本文整理汇总了PHP中SimpleORMap::store方法的典型用法代码示例。如果您正苦于以下问题:PHP SimpleORMap::store方法的具体用法?PHP SimpleORMap::store怎么用?PHP SimpleORMap::store使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SimpleORMap的用法示例。


在下文中一共展示了SimpleORMap::store方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: store

 public function store()
 {
     if (!$this['public_key']) {
         $this->createKeys();
     }
     return parent::store();
 }
开发者ID:Krassmus,项目名称:LehrMarktplatz,代码行数:7,代码来源:LernmarktplatzIdentity.php

示例2: store

 /**
  * {@inheritdoc }
  */
 public function store()
 {
     if ($this->isNew()) {
         $sql = "SELECT MAX(position)+1 FROM statusgruppe_user WHERE statusgruppe_id = ?";
         $stmt = DBManager::get()->prepare($sql);
         $stmt->execute(array($this->statusgruppe_id));
         $this->position = $stmt->fetchColumn();
     }
     return parent::store();
 }
开发者ID:ratbird,项目名称:hope,代码行数:13,代码来源:StatusgruppeUser.php

示例3: store

 /**
  * Stores the object and fetches the opengraph information when either
  * the object is new or outdated.
  *
  * @return int Number of updated records
  */
 public function store()
 {
     if ($this->isNew() || $this->last_update < time() - self::EXPIRES_DURATION) {
         $this->fetch();
         $this->last_update = time();
     }
     return parent::store();
 }
开发者ID:ratbird,项目名称:hope,代码行数:14,代码来源:OpenGraphURL.class.php

示例4: store

 public function store()
 {
     if (!$this->user_id) {
         $this->user_id = $GLOBALS['user']->id;
     }
     $this->closed = (int) $this->closed;
     if ($this->resource_id || $this->getSettedPropertiesCount()) {
         if (!$this->category_id && $this->resource) {
             $this->category_id = $this->resource->category_id;
         }
         if ($this->isNew() && !$this->getId()) {
             $this->setId($this->getNewId());
         }
         if ($this->properties_changed) {
             $properties_changed = $this->properties_changed;
             $properties_stored = $this->storeProperties();
         }
         if ($properties_stored || $this->isDirty()) {
             $this->last_modified_by = $GLOBALS['user']->id;
         }
         $is_new = $this->isNew();
         $stored = parent::store();
         // LOGGING
         $props = "";
         foreach ($this->properties as $key => $val) {
             $props .= $val['name'] . "=" . $val['state'] . " ";
         }
         if (!$props) {
             $props = "--";
         }
         if ($is_new) {
             log_event("RES_REQUEST_NEW", $this->seminar_id, $this->resource_id, "Termin: {$this->termin_id}, Metadate: {$this->metadate_id}, Properties: {$props}, Kommentar: {$this->comment}", $query);
         } else {
             if ($properties_changed && !$stored) {
                 $this->triggerChdate();
             }
             if ($stored) {
                 if ($this->closed == 1 || $this->closed == 2) {
                     log_event("RES_REQUEST_RESOLVE", $this->seminar_id, $this->resource_id, "Termin: {$this->termin_id}, Metadate: {$this->metadate_id}, Properties: {$props}, Status: " . $this->closed, $query);
                 } else {
                     if ($this->closed == 3) {
                         log_event("RES_REQUEST_DENY", $this->seminar_id, $this->resource_id, "Termin: {$this->termin_id}, Metadate: {$this->metadate_id}, Properties: {$props}, Status: " . $this->closed, $query);
                     } else {
                         log_event("RES_REQUEST_UPDATE", $this->seminar_id, $this->resource_id, "Termin: {$this->termin_id}, Metadate: {$this->metadate_id}, Properties: {$props}, Status: " . $this->closed, $query);
                     }
                 }
             }
         }
     }
     return $stored || $properties_changed;
 }
开发者ID:ratbird,项目名称:hope,代码行数:51,代码来源:RoomRequest.class.php

示例5: store

 public function store()
 {
     NotificationCenter::postNotification("PostingWillSave", $this);
     $success = parent::store();
     if ($success) {
         NotificationCenter::postNotification("PostingHasSaved", $this);
     }
     return $success;
 }
开发者ID:noackorama,项目名称:blubberforum,代码行数:9,代码来源:ForumPosting.class.php

示例6: store

 /**
  * Stores this cycle.
  * @return int number of changed rows
  */
 public function store()
 {
     $cycle = parent::findByMetadate_id($this->metadate_id);
     //create new entry in seminare_cycle_date
     if (!$cycle) {
         $result = parent::store();
         if ($result) {
             $new_dates = $this->createTerminSlots();
             foreach ($new_dates as $semester_dates) {
                 foreach ($semester_dates['dates'] as $date) {
                     $result += $date->store();
                 }
             }
             StudipLog::log('SEM_ADD_CYCLE', $this->seminar_id, NULL, $this->toString());
             return $result;
         }
         return 0;
     }
     //change existing cycledate, changes also corresponding single dates
     $old_cycle = SeminarCycleDate::find($this->metadate_id);
     if (!parent::store()) {
         return false;
     }
     if (mktime($this->start_time) >= mktime($old_cycle->start_time) && mktime($this->end_time) <= mktime($old_cycle->end_time) && $this->weekday == $old_cycle->weekday && $this->end_offset == $old_cycle->end_offset) {
         $update_count = 0;
         foreach ($this->getAllDates() as $date) {
             $tos = $date->date;
             $toe = $date->end_time;
             //Update future dates
             if ($toe > time()) {
                 $date->date = mktime(date('G', strtotime($this->start_time)), date('i', strtotime($this->start_time)), 0, date('m', $tos), date('d', $tos), date('Y', $tos));
                 $date->end_time = mktime(date('G', strtotime($this->end_time)), date('i', strtotime($this->end_time)), 0, date('m', $toe), date('d', $toe), date('Y', $toe));
             }
             if ($date->isDirty()) {
                 $date->store();
                 $update_count++;
             }
         }
         StudipLog::log('SEM_CHANGE_CYCLE', $this->seminar_id, NULL, $old_cycle->toString() . ' -> ' . $this->toString());
         return $update_count;
     }
     //collect topics for existing future dates (CourseDate)
     $topics = array();
     foreach ($this->getAllDates() as $date) {
         if ($date->end_time >= time()) {
             $topics_tmp = CourseTopic::findByTermin_id($date->termin_id);
             if (!empty($topics_tmp)) {
                 $topics[] = $topics_tmp;
             }
             //uncomment below
             $date->delete();
         }
     }
     $new_dates = $this->createTerminSlots(time());
     $topic_count = 0;
     $update_count = 0;
     foreach ($new_dates as $semester_dates) {
         foreach ($semester_dates['dates'] as $date) {
             if ($date instanceof CourseDate) {
                 if (isset($topics[$topic_count])) {
                     $date->topics = $topics[$topic_count];
                     $topic_count++;
                 }
             }
             $date->store();
             $update_count++;
         }
     }
     StudipLog::log('SEM_CHANGE_CYCLE', $this->seminar_id, NULL, $old_cycle->toString() . ' -> ' . $this->toString());
     return $update_count;
 }
开发者ID:ratbird,项目名称:hope,代码行数:75,代码来源:SeminarCycleDate.class.php

示例7: store

 public function store()
 {
     $this->cbSerializeData();
     parent::store();
 }
开发者ID:noackorama,项目名称:blubberforum,代码行数:5,代码来源:BlubberExternalContact.class.php

示例8: store

 /**
  * Stores this date.
  *
  * @return bool indicating whether the date was stored or not
  */
 public function store()
 {
     $old_entry = CourseDate::find($this->termin_id);
     if ($this->isNew() && !isset($this->metadate_id) && parent::store()) {
         log_event('SEM_ADD_SINGLEDATE', $this->range_id, $this->getFullname());
         return true;
     }
     if (!$this->isNew() && !isset($this->metadate_id) && parent::store()) {
         if ($old_entry->date != $this->date || $old_entry->end_time != $this->end_time) {
             log_event('SINGLEDATE_CHANGE_TIME', $this->range_id, $old_entry->getFullname(), $old_entry->getFullname() . ' -> ' . $this->getFullname());
         }
         return true;
     }
     if (parent::store()) {
         return true;
     }
     return false;
 }
开发者ID:ratbird,项目名称:hope,代码行数:23,代码来源:CourseDate.class.php

示例9: store

 /**
  * Stores the schedule in database. Will bail out with an exception if
  * the provided task does not exists. Will also nullify the title if it
  * matches the task name (see CronjobSchedule::getTitle()).
  *
  * @return CronjobSchedule Returns itself to allow chaining
  */
 public function store()
 {
     if ($this->task === null) {
         $message = sprintf('A task with the id "%s" does not exist.', $this->task_id);
         throw new InvalidArgumentException($message);
     }
     // Remove title if it is the default (task's name)
     if ($this->title === $this->task->name) {
         $this->title = null;
     }
     parent::store();
     return $this;
 }
开发者ID:ratbird,项目名称:hope,代码行数:20,代码来源:CronjobSchedule.class.php


注:本文中的SimpleORMap::store方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。