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


PHP ArrayCollection::get方法代码示例

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


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

示例1: getParameter

 public function getParameter($parameter)
 {
     if (!$this->configs instanceof ArrayCollection) {
         $this->generateConfigs($file = 'parameters.yml', null, false);
     }
     return $this->configs->get($parameter);
 }
开发者ID:ner0tic,项目名称:landmarxApp,代码行数:7,代码来源:UtilityController.php

示例2: getParser

 /**
  * Gets a MarkdownParserInterface of the specified name/alias.
  *
  * @param string $name The parser name
  *
  * @return MarkdownParserInterface
  */
 public function getParser($name)
 {
     if ($this->hasParser($name) === false) {
         throw new \InvalidArgumentException(sprintf('The Markdown parser "%s" is not found.', $name));
     }
     return $this->parsers->get($name);
 }
开发者ID:Raphy,项目名称:RaphyMarkdownBundle,代码行数:14,代码来源:ParserCollection.php

示例3: getPool

 /**
  * @param string $name
  *
  * @return CacheItemPoolInterface
  * @throws RuntimeException
  */
 public function getPool($name) : CacheItemPoolInterface
 {
     if (!$this->hasPool($name)) {
         throw new RuntimeException(sprintf('Could not find cache pool with name %s.', $name));
     }
     return $this->pools->get($name);
 }
开发者ID:phpro,项目名称:annotated-cache,代码行数:13,代码来源:PoolManager.php

示例4: enableContentProvider

 /**
  * Enable content provider by name.
  *
  * @param string $name
  * @return ContentProviderManager
  */
 public function enableContentProvider($name)
 {
     if ($this->hasContentProvider($name)) {
         $this->contentProviders->get($name)->setEnabled(true);
     }
     return $this;
 }
开发者ID:Maksold,项目名称:platform,代码行数:13,代码来源:ContentProviderManager.php

示例5: searchEntity

 /**
  * @param ImportRowProcess $item
  * @return bool|mixed|null
  */
 protected function searchEntity(ImportRowProcess $item)
 {
     $rowKey = $item->getRowKey();
     if (!isset($this->entityKeyByRowKey[md5($rowKey)])) {
         return false;
     }
     return $this->entityCollection->get($this->entityKeyByRowKey[md5($rowKey)]);
 }
开发者ID:jarold87,项目名称:pingvin,代码行数:12,代码来源:ItemCollectorByValuesInRowProcessList.php

示例6: getDefault

 /**
  *
  * @param string $key
  * @param string $section
  * @return \Doctrine\Common\Collections\ArrayCollection
  */
 public function getDefault($key, $section = "default")
 {
     $data = null;
     if ($this->defaults->containsKey($section . '.' . $key)) {
         $data = $this->defaults->get($section . '.' . $key);
     }
     return $data;
 }
开发者ID:symbb,项目名称:symbb,代码行数:14,代码来源:ConfigManager.php

示例7: searchEntity

 /**
  * @param ImportItemProcess $item
  * @return bool|mixed|null
  */
 protected function searchEntity(ImportItemProcess $item)
 {
     $outerId = $item->getItemValue();
     if (!isset($this->entityKeyByOuterId[$outerId])) {
         return false;
     }
     return $this->entityCollection->get($this->entityKeyByOuterId[$outerId]);
 }
开发者ID:jarold87,项目名称:pingvin,代码行数:12,代码来源:ItemCollectorByLoadFromUserDatabase.php

示例8: getAuditEntryFieldClass

 /**
  * @param AbstractUser $user
  * @return string
  */
 public function getAuditEntryFieldClass(AbstractUser $user)
 {
     $userClass = ClassUtils::getRealClass($user);
     if (!$this->entryFieldMap->containsKey($userClass)) {
         throw new \InvalidArgumentException(sprintf('Audit entry field not found for "%s"', $userClass));
     }
     return $this->entryFieldMap->get($userClass);
 }
开发者ID:anyt,项目名称:platform,代码行数:12,代码来源:AuditEntityMapper.php

示例9: testGetNumbersForExistinUserWillReturn200ResponseWithNumbersList

 public function testGetNumbersForExistinUserWillReturn200ResponseWithNumbersList()
 {
     $this->client->request('GET', '/users/1/numbers');
     $response = $this->client->getResponse();
     $this->assertJsonResponse($response, 200);
     $numbers = new ArrayCollection($this->getContainer()->get('jms_serializer')->deserialize($response->getContent(), 'array<Arkon\\Bundle\\PhoneBookBundle\\Entity\\PhoneNumber>', 'json'));
     $this->assertSame(694984427, $numbers->get(0)->getNumber());
     $this->assertSame(724489496, $numbers->get(1)->getNumber());
 }
开发者ID:Nakard,项目名称:hexagonal_phonebook,代码行数:9,代码来源:GetUserNumbersControllerTest.php

示例10: build

 /**
  * @param  ArrayCollection $data
  * @return Artice
  */
 public function build(ArrayCollection $data)
 {
     $article = new Article();
     $article->setTitle($data->get('title'));
     $article->setDescription($data->get('description'));
     $article->setUrl($data->get('url'));
     $article->setFeed($data->get('feed'));
     $article->onPrePersist();
     return $article;
 }
开发者ID:ffff5912,项目名称:antena,代码行数:14,代码来源:ArticleFactory.php

示例11: getAuditEntryFieldClass

 /**
  * @param DiamanteUser|null $user
  *
  * @return string
  */
 public function getAuditEntryFieldClass(DiamanteUser $user = null)
 {
     if ($user === null) {
         return $this->entryFieldMap->first();
     }
     $userClass = ClassUtils::getRealClass($user);
     if (!$this->entryFieldMap->containsKey($userClass)) {
         throw new \InvalidArgumentException(sprintf('Audit entry field not found for "%s"', $userClass));
     }
     return $this->entryFieldMap->get($userClass);
 }
开发者ID:gitter-badger,项目名称:diamantedesk-application,代码行数:16,代码来源:AuditEntityMapper.php

示例12: find

 /**
  * @inheritdoc
  */
 public function find(Uuid $uuid)
 {
     return $this->collection->get((string) $uuid);
     /*
             $criteria = Criteria::create()->where(Criteria::expr()->in('id', [$uuid]));
             $result = $this->collection->matching($criteria);
     
             if ($result->count()) {
                 return $result->first();
             }
     
             return null;*/
 }
开发者ID:xtreamwayz,项目名称:zend-expressive-app-poc,代码行数:16,代码来源:InMemoryUserRepository.php

示例13: getOxfordItems

 /**
  * Return the last oxford comma eligible word
  * in the sentence
  *
  * @return ArrayCollection|Word[]
  */
 public function getOxfordItems()
 {
     $words = new ArrayCollection();
     $conjunctions = $this->words->filter(function (Word $word) {
         return $word instanceof Conjunction;
     });
     $conjunctions->map(function ($word) use($words) {
         if ($this->hasOxfordable($word)) {
             $index = $this->words->indexOf($word) - 1;
             $words->add($this->words->get($index));
         }
     });
     return $words;
 }
开发者ID:epfremmer,项目名称:PHP-Weekly-Issue28,代码行数:20,代码来源:Sentence.php

示例14: generate

 /**
  * @param BundleInterface $bundle
  * @param string $entity
  * @param ClassMetadataInfo $metadata
  * @param ArrayCollection $options
  *
  * @throws \RuntimeException
  */
 public function generate(BundleInterface $bundle, $entity, ClassMetadataInfo $metadata, ArrayCollection $options = null)
 {
     $this->routePrefix = $options->get('route-prefix');
     $this->routeNamePrefix = str_replace('/', '_', $options->get('route-prefix'));
     $this->actions = ['getById', 'getAll', 'post', 'put', 'delete'];
     if (count($metadata->identifier) > 1) {
         throw new \RuntimeException('The REST Controller generator does not support entity classes with multiple primary keys.');
     }
     $this->entity = $entity;
     $this->bundle = $bundle;
     $this->metadata = $metadata;
     $this->setFormat('yml');
     $this->generateControllerClass($options->get('overwrite'), $options->get('document'), $options->get('resource'), $metadata);
 }
开发者ID:stopfstedt,项目名称:TdnPilotBundle,代码行数:22,代码来源:ControllerGenerator.php

示例15: getParameter

 /**
  * Get parameter.
  *
  * @param string $parameter
  * @param mixed  $default
  *
  * @return mixed
  */
 public function getParameter($parameter, $default = null)
 {
     if (!$this->parameters instanceof ArrayCollection) {
         return $default;
     }
     return $this->parameters->containsKey($parameter) ? $this->parameters->get($parameter) : $default;
 }
开发者ID:juliangut,项目名称:tify,代码行数:15,代码来源:ParameterTrait.php


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