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


PHP Doctrine_Collection::merge方法代碼示例

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


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

示例1: getNodes

 protected function getNodes($recreate = false)
 {
     if ($recreate || !self::$nodes) {
         $coll = new Doctrine_Collection('Structure', 'id');
         self::$nodes = $coll->merge($this->getMenuItemFetchingQuery()->execute());
     }
     return self::$nodes;
 }
開發者ID:vcgato29,項目名稱:poff,代碼行數:8,代碼來源:components.class.php

示例2: loadCategoriesConnections

 public function loadCategoriesConnections($cats, &$dataArray)
 {
     $coll = new Doctrine_Collection('ProductGroup', 'import_code');
     $allCats = Doctrine::getTable('ProductGroup')->createQuery('imported_groups')->from('ProductGroup pg')->where('pg.import_code != ?', 'NULL')->execute();
     $allCats = $coll->merge($allCats);
     foreach ($cats as $index => $cat) {
         if ($allCats->contains($cat['id'])) {
             $cat_obj = $allCats->get($cat['id']);
             $dataArray['ProductGroups'][$index]['group_id'] = $cat_obj['id'];
         }
     }
 }
開發者ID:vcgato29,項目名稱:poff,代碼行數:12,代碼來源:VideosMapper.class.php

示例3: getSegmentItems

 public function getSegmentItems($items, $root_level = 0, $iterations = null)
 {
     $segment = new Doctrine_Collection('csNavigationItem');
     foreach ($items as $item) {
         $children = $this->getSegmentItems($item->getChildren(), $root_level, $iterations);
         // If the level is beneath this one, return the children of this object
         if ($item->level <= $root_level) {
             $segment->merge($children);
         } elseif (!$iterations || $item->getLevel() <= $root_level + $iterations) {
             $new_segment = clone $item;
             $new_segment->setChildren($children);
             $segment[] = $new_segment;
         }
     }
     return $segment;
 }
開發者ID:bshaffer,項目名稱:Symplist,代碼行數:16,代碼來源:PlugincsNavigationMenu.class.php


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