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


PHP ArrayCollection::getKeys方法代碼示例

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


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

示例1: getKeys

 public function getKeys()
 {
     if (null === $this->entries) {
         $this->__load___();
     }
     return $this->entries->getKeys();
 }
開發者ID:luisbrito,項目名稱:Phraseanet,代碼行數:7,代碼來源:AggregateEntryCollection.php

示例2: query

 /**
  * Queries for Keys matching a case insensitive expression
  *
  * @param  string $match The expression to match against
  *
  * @return array
  */
 public function query($match)
 {
     $keys = $this->index->getKeys();
     $matches = array_filter($keys, function ($key) use($match) {
         return preg_match("/{$match}/i", $key);
     });
     $results = [];
     foreach ($matches as $match) {
         $result = $this->get($match);
         $results[key($result)] = current($result);
     }
     return $results;
 }
開發者ID:kmfk,項目名稱:slowdb,代碼行數:20,代碼來源:Collection.php

示例3: testGetKeys

 /**
  * @dataProvider provideDifferentElements
  */
 public function testGetKeys($elements)
 {
     $collection = new ArrayCollection($elements);
     $this->assertSame(array_keys($elements), $collection->getKeys());
 }
開發者ID:tccLaravel,項目名稱:test4,代碼行數:8,代碼來源:ArrayCollectionTest.php

示例4: getKeys

 /** {@inheritDoc} */
 public function getKeys()
 {
     $this->initialize();
     return $this->collection->getKeys();
 }
開發者ID:nikophil,項目名稱:cmf-tests,代碼行數:6,代碼來源:PersistentCollection.php

示例5: getKeys

 /**
  * Gets all keys/indices of the collection.
  *
  * @return array The keys/indices of the collection, in the order of the corresponding
  *               elements in the collection.
  */
 public function getKeys()
 {
     return $this->collection->getKeys();
 }
開發者ID:Rybbow,項目名稱:x-blog,代碼行數:10,代碼來源:ImmutableCollection.php

示例6: getCars

 /**
  * @return array of Car
  */
 public function getCars()
 {
     $car_ids = $this->cars->getKeys();
     return $this->em->getRepository('AppBundle:Car')->findBy(array('id' => $car_ids));
 }
開發者ID:s181150,項目名稱:my_project_name,代碼行數:8,代碼來源:Cart.php

示例7: dropAll

 /**
  * Drops all the Collection in the Database
  */
 public function dropAll()
 {
     foreach ($this->collections->getKeys() as $collection) {
         $this->drop($collection);
     }
 }
開發者ID:kmfk,項目名稱:slowdb,代碼行數:9,代碼來源:Database.php

示例8: getKeys

 function getKeys()
 {
     return $this->fields->getKeys();
 }
開發者ID:tomaszhanc,項目名稱:form-field-bundle,代碼行數:4,代碼來源:FieldCollection.php


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