当前位置: 首页>>代码示例>>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;未经允许,请勿转载。