當前位置: 首頁>>代碼示例>>PHP>>正文


PHP RedBeanModel::save方法代碼示例

本文整理匯總了PHP中RedBeanModel::save方法的典型用法代碼示例。如果您正苦於以下問題:PHP RedBeanModel::save方法的具體用法?PHP RedBeanModel::save怎麽用?PHP RedBeanModel::save使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在RedBeanModel的用法示例。


在下文中一共展示了RedBeanModel::save方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: save

 /**
  * Any changes to the model must be re-cached.
  * @see RedBeanModel::save()
  */
 public function save($runValidation = true, array $attributeNames = null)
 {
     $saved = parent::save($runValidation, $attributeNames);
     if ($saved) {
         GeneralCache::cacheEntry('CustomFieldData' . $this->name, $this);
     }
     return $saved;
 }
開發者ID:youprofit,項目名稱:Zurmo,代碼行數:12,代碼來源:CustomFieldData.php

示例2: processCreateAction

 protected function processCreateAction()
 {
     if ($this->resolveCreateModel($this->triggeredModel, $this->action->relation) && $this->canSaveTriggeredModel) {
         $saved = $this->triggeredModel->save();
         if (!$saved) {
             throw new FailedToSaveModelException();
         }
     }
 }
開發者ID:maruthisivaprasad,項目名稱:zurmo,代碼行數:9,代碼來源:WorkflowActionProcessingHelper.php

示例3: processAfterCopy

 public static function processAfterCopy(RedBeanModel $model, RedBeanModel $copyToModel)
 {
     foreach ($model->tasks as $task) {
         $copyToTask = new Task();
         TaskActivityCopyModelUtil::copy($task, $copyToTask);
         $copyToTask->status = Task::STATUS_NEW;
         $copyToModel->tasks->add($copyToTask);
     }
     $copyToModel->save();
 }
開發者ID:maruthisivaprasad,項目名稱:zurmo,代碼行數:10,代碼來源:ProjectZurmoCopyModelUtil.php

示例4: unrestrictedSave

 public function unrestrictedSave($runValidation = true, array $attributeNames = null)
 {
     return parent::save($runValidation, $attributeNames);
 }
開發者ID:maruthisivaprasad,項目名稱:zurmo,代碼行數:4,代碼來源:OwnedModel.php

示例5: saveAndReloadModel

 public static function saveAndReloadModel(RedBeanModel $model)
 {
     $saved = $model->save();
     if (!$saved) {
         throw new FailedToSaveModelException();
     }
     $modelId = $model->id;
     $modelClassName = get_class($model);
     $model->forget();
     unset($model);
     return $modelClassName::getById($modelId);
 }
開發者ID:youprofit,項目名稱:Zurmo,代碼行數:12,代碼來源:WorkflowTriggersUtilBaseTest.php

示例6: save

 /**
  * Override to resetCache after a currency is saved.
  * (non-PHPdoc)
  * @see RedBeanModel::save()
  */
 public function save($runValidation = true, array $attributeNames = null)
 {
     $saved = parent::save($runValidation, $attributeNames);
     self::resetCaches();
     return $saved;
 }
開發者ID:youprofit,項目名稱:Zurmo,代碼行數:11,代碼來源:Currency.php

示例7: refreshModel

 protected static function refreshModel(RedBeanModel &$model)
 {
     assert('$model->id > 0');
     // this is just a fail safe. We don't want to lose any unsaved changes.
     // ideally $model should be saved by this point anyway, but regardless:
     if ($model->isModified() && !$model->save()) {
         throw new FailedToSaveModelException();
     }
     $modelId = $model->id;
     $modelClass = get_class($model);
     $model->forgetAll();
     $model = $modelClass::getById($modelId);
 }
開發者ID:RamaKavanan,項目名稱:InitialVersion,代碼行數:13,代碼來源:EmailBoxUtil.php


注:本文中的RedBeanModel::save方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。