當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。