本文整理匯總了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();
}
示例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;
}
示例3: testGetKeys
/**
* @dataProvider provideDifferentElements
*/
public function testGetKeys($elements)
{
$collection = new ArrayCollection($elements);
$this->assertSame(array_keys($elements), $collection->getKeys());
}
示例4: getKeys
/** {@inheritDoc} */
public function getKeys()
{
$this->initialize();
return $this->collection->getKeys();
}
示例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();
}
示例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));
}
示例7: dropAll
/**
* Drops all the Collection in the Database
*/
public function dropAll()
{
foreach ($this->collections->getKeys() as $collection) {
$this->drop($collection);
}
}
示例8: getKeys
function getKeys()
{
return $this->fields->getKeys();
}