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