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


PHP R::storeAll方法代码示例

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


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

示例1: addTo

 public function addTo(Set $set)
 {
     $setBean = $set->getBean();
     $recordBean = $this->newBean();
     foreach ($this->directives as $directive) {
         $recordBean->{$directive->field->cleanName} = $directive->value;
     }
     $setBean->{'own' . ucfirst($this->cleanName) . 'List'}[] = $recordBean;
     R::storeAll([$recordBean, $setBean]);
     return $this;
 }
开发者ID:skema,项目名称:skema,代码行数:11,代码来源:Record.php

示例2: create

 public static function create($module, $component, $group)
 {
     if (self::isUnique($module, $component, $group->name)) {
         $bean = R::dispense('perm');
         $groupBean = $group->bean();
         $bean->groupName = $group->name;
         $bean->module = $module;
         $bean->component = $component;
         $groupBean->sharedPermList[] = $bean;
         R::storeAll([$bean, $groupBean]);
         return new Perm($module, $component, $group);
     }
     return null;
 }
开发者ID:Koohiisan,项目名称:Enpowi,代码行数:14,代码来源:Perm.php

示例3: checkOut

 public static function checkOut($number, Publisher $publisher)
 {
     if (R::count('record', ' number = :number AND isnull(`in`) ', ['number' => $number]) > 0) {
         return null;
     }
     $territoryBean = R::findOne('territory', ' number = :number ', ['number' => $number]);
     if ($territoryBean === null) {
         return null;
     }
     $bean = R::dispense('record');
     $bean->number = $number;
     $bean->out = time();
     $bean->in = null;
     $bean->checkOutBy = App::user()->id;
     $record = new Record($number, $bean);
     $territoryBean->sharedRecordList[] = $bean;
     $publisherBean = $publisher->bean();
     $publisherBean->ownRecordList[] = $bean;
     R::storeAll([$bean, $territoryBean, $publisherBean]);
     $publisher->records[] = $record;
     return $record;
 }
开发者ID:vallevista,项目名称:etm2.temp,代码行数:22,代码来源:Record.php

示例4: __invoke

 public function __invoke($school_id)
 {
     $school = $this->schoolService->getSchool($school_id);
     try {
         $equipment = $this->inventoryService->getUnitEquipment($school['registry_no']);
     } catch (Exception $e) {
         $this->logger->error(sprintf('Problem retrieving assets from inventory for school %s', $school_id));
         $this->logger->debug('Exception', [$e->getMessage(), $e->getTraceAsString()]);
         return false;
     }
     $labTypes = $this->getLabTypes();
     $assetTypes = $this->getAssetTypes();
     try {
         $locations = $this->getLocations($school_id, $equipment, $labTypes, $assetTypes);
         R::storeAll($locations);
         $this->logger->info(sprintf('Add assets from inventory for school %s', $school_id));
         return $this->labService->getLabsBySchoolId($school_id);
     } catch (Exception $e) {
         $this->logger->error(sprintf('Problem inserting assets for school %s in database', $school_id));
         $this->logger->debug('Exception', [$e->getMessage(), $e->getTraceAsString()]);
         return false;
     }
 }
开发者ID:kanellov,项目名称:gredu_labs,代码行数:23,代码来源:SyncFromInventory.php

示例5: addToSet

 public function addToSet(Set $set)
 {
     $setBean = $set->getBean();
     if (R::count('skemafield', ' name = ? and skemaset_id = ? ', [$this->name, $setBean->getID()]) > 0) {
         if (Set::$strict) {
             throw new \Exception('Already exists on set');
         }
         return $this;
     }
     $fieldBean = $this->newBean();
     $set->fields[$this->cleanName] = $this;
     $this->set = $set;
     $setBean->ownSkemafieldList[] = $fieldBean;
     R::storeAll([$fieldBean, $setBean]);
     return $this;
 }
开发者ID:skema,项目名称:skema,代码行数:16,代码来源:Base.php


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