本文整理汇总了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();
}