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


PHP ArrayCollection::__construct方法代碼示例

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


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

示例1: __construct

 /**
  * Taxonomy constructor.
  *
  * @param array          $elements
  * @param MetadataDriver $metadata
  */
 public function __construct(array $elements = [], MetadataDriver $metadata = null)
 {
     parent::__construct($elements);
     if ($metadata) {
         $this->config = $metadata->getTaxonomyConfig();
     }
 }
開發者ID:d-m-,項目名稱:bolt,代碼行數:13,代碼來源:Taxonomy.php

示例2: __construct

 public function __construct(array $elements = [])
 {
     foreach ($elements as $element) {
         $this->validate($element);
     }
     parent::__construct($elements);
 }
開發者ID:kreta,項目名稱:kreta,代碼行數:7,代碼來源:Collection.php

示例3: __construct

 public function __construct(array $array, array $config = NULL)
 {
     if ($config) {
         $this->set('config', new DoctineArrayCollection($config));
     }
     parent::__construct($array);
 }
開發者ID:gpupo,項目名稱:camelspider,代碼行數:7,代碼來源:AbstractSpiderEgg.php

示例4: __construct

 /**
  * Constructs a Route object.
  */
 public function __construct($path, array $item)
 {
     $this->path = new PathUtility($path);
     // Merge in hook_menu() defaults to normalize things.
     $item += ['title callback' => 't', 'title arguments' => [], 'access callback' => 'user_access', 'access arguments' => [], 'page arguments' => [], 'type' => 'MENU_NORMAL_ITEM'];
     parent::__construct($item);
 }
開發者ID:nishantkumar155,項目名稱:drupal8.crackle,代碼行數:10,代碼來源:RouteWrapper.php

示例5: __construct

 /**
  * @param array $elements
  * @param null  $page
  * @param int   $rpp
  * @param null  $total
  */
 public function __construct(array $elements = [], $page = null, $rpp = 10, $total = null)
 {
     $this->page = $page;
     $this->rpp = $rpp;
     $this->total = $total;
     parent::__construct($elements);
 }
開發者ID:javihgil,項目名稱:doctrine-pagination,代碼行數:13,代碼來源:PaginatedArrayCollection.php

示例6: __construct

 /**
  * Constructor
  *
  * @param array           $elements
  * @param ArrayCollection $received
  * @param Basket          $basket
  * @param Boolean         $flatten
  */
 public function __construct(array $elements, ArrayCollection $received, Basket $basket = null, $flatten = self::FLATTEN_NO)
 {
     parent::__construct($elements);
     $this->received = $received;
     $this->basket = $basket;
     $this->isSingleStory = $flatten !== self::FLATTEN_YES && 1 === count($this) && $this->first()->isStory();
     if (self::FLATTEN_NO !== $flatten) {
         $to_remove = [];
         foreach ($this as $key => $record) {
             if ($record->isStory()) {
                 if (self::FLATTEN_YES === $flatten) {
                     $to_remove[] = $key;
                 }
                 foreach ($record->get_children() as $child) {
                     $this->set($child->get_serialize_key(), $child);
                 }
             }
         }
         foreach ($to_remove as $key) {
             $this->remove($key);
         }
     }
     $i = 0;
     $records = $this->toArray();
     array_walk($records, function ($record) use(&$i) {
         $record->setNumber($i++);
     });
 }
開發者ID:luisbrito,項目名稱:Phraseanet,代碼行數:36,代碼來源:RecordsRequest.php

示例7: __construct

 public function __construct(array $elements = array())
 {
     parent::__construct();
     foreach ($elements as $element) {
         $this->add($element);
     }
 }
開發者ID:goodhacker,項目名稱:marlon-csrfscanner,代碼行數:7,代碼來源:DomainsCollection.php

示例8: __construct

 public function __construct(array $elements = array(), $offset, $limit, $totalCount)
 {
     $this->offset = (int) $offset;
     $this->limit = (int) $limit;
     $this->totalCount = (int) $totalCount;
     parent::__construct($elements);
 }
開發者ID:kinger-de,項目名稱:symfony-cqrs-edition,代碼行數:7,代碼來源:ViewModelCollection.php

示例9: __construct

 public function __construct(array $days = [])
 {
     parent::__construct();
     foreach ($days as $day) {
         $this->addDay($day);
     }
 }
開發者ID:hrevert,項目名稱:day-of-week,代碼行數:7,代碼來源:DayCollection.php

示例10: __construct

 /**
  * Initializes a new Result.
  *
  * @param Query   $query
  * @param array   $elements
  * @param integer $recordsCount
  */
 public function __construct(Query $query, array $elements = array(), $recordsCount = 0)
 {
     $this->query = $query;
     $this->recordsCount = $recordsCount;
     parent::__construct($elements);
     $this->count = $this->count();
     $this->elements = $elements;
 }
開發者ID:Maksold,項目名稱:platform,代碼行數:15,代碼來源:Result.php

示例11: __construct

 /**
  * Initializes a new ModulesCollection.
  *
  * @param Module[] $modules
  */
 public function __construct(array $modules = array())
 {
     $constructed = array();
     foreach ($modules as $module) {
         $constructed[$module->getIdentifier()] = $module;
     }
     parent::__construct($constructed);
 }
開發者ID:ChrisdAutume,項目名稱:EtuUTT,代碼行數:13,代碼來源:ModulesCollection.php

示例12: __construct

 /**
  * Initializes a new ArrayCollection.
  *
  * @param array $elements
  * @param bool  $hasBeenRandomized
  */
 public function __construct(array $elements = array(), $hasBeenRandomized = false)
 {
     parent::__construct();
     foreach ($elements as $element) {
         $this->add($element);
     }
     $this->hasBeenRandomized = $hasBeenRandomized;
 }
開發者ID:rbaarsma,項目名稱:fastest,代碼行數:14,代碼來源:TestsQueue.php

示例13: __construct

 /**
  * {@inheritdoc}
  */
 public function __construct(array $elements = [])
 {
     parent::__construct($elements);
     $this->keys = [];
     foreach ($elements as $element) {
         $this->keys[(string) $element] = true;
     }
 }
開發者ID:startupz,項目名稱:platform-1,代碼行數:11,代碼來源:PublicResourceCollection.php

示例14: __construct

 public function __construct(array $elements = array())
 {
     parent::__construct($elements);
     $this->add(new EqualsSearchOperator());
     $this->add(new LikeSearchOperator());
     $this->add(new LikeApproxSearchOperator());
     $this->add(new GreaterThanSearchOperator());
     $this->add(new LowerThanSearchOperator());
 }
開發者ID:RSSfeed,項目名稱:AdminBundle,代碼行數:9,代碼來源:SearchOperators.php

示例15: __construct

 public function __construct(array $elements)
 {
     foreach ($elements as $element) {
         if (!$element instanceof ClientAccount) {
             throw new \InvalidArgumentException('Elements must be instance of ClientAccount.');
         }
     }
     parent::__construct(array_values($elements));
 }
開發者ID:junjinZ,項目名稱:wealthbot,代碼行數:9,代碼來源:ConsolidatedAccountsCollection.php


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