本文整理汇总了PHP中Collection::remove方法的典型用法代码示例。如果您正苦于以下问题:PHP Collection::remove方法的具体用法?PHP Collection::remove怎么用?PHP Collection::remove使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Collection
的用法示例。
在下文中一共展示了Collection::remove方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testRemove
/**
* @test Collection::remove()
*/
public function testRemove()
{
$this->buildEnvironment();
$expect = $this->source;
unset($expect['a1']);
$result = $this->collection->remove('a1')->fetch();
$this->assertEquals($expect, $result);
}
示例2: remove
/**
* @{@inheritdoc}
*/
public function remove($key)
{
$return = parent::remove($key);
if ($return) {
$this->removeFromHistory($return);
}
return $return;
}
示例3: remove
public function remove($product)
{
parent::remove($product);
//check if the item is in the quantity map, and remove if so
if (array_key_exists($product->id, $this->quantity_product_map)) {
unset($this->quantity_product_map[$product->id]);
}
}
示例4: remove
/**
* /
* @param [type] $id [description]
* @return [type] [description]
*/
public function remove($id)
{
if (!is_string($id)) {
throw new \Exception("Cookie index must be string", 02);
}
$newId = str_replace('.', '_', $id);
setcookie($newId, '', time() - 3600);
parent::remove($newId);
}
示例5: remove
/**
* {@inheritdoc}
*/
public function remove($key)
{
$this->initialize();
$removed = $this->coll->remove($key);
if ($removed) {
$this->changed();
if ($this->mapping !== null && isset($this->mapping['embedded'])) {
$this->uow->scheduleOrphanRemoval($removed);
}
}
return $removed;
}
示例6: remove
/**
* @param $index
*/
public function remove($index)
{
$this->discounts->remove($index);
}
示例7: testHasKeyRemoveClearIndexes
public function testHasKeyRemoveClearIndexes()
{
$this->assertEquals(true, $this->collection->hasKey(3));
$this->collection->remove(3);
$this->assertEquals(false, $this->collection->hasKey(3));
}
示例8: remove
/**
* Remove an instance from the list and from the corresponding group
*
* @param string $identifier
* @return void
*/
public function remove($identifier)
{
parent::remove($identifier);
/** @var PropertyGroup $group */
foreach ($this->groups as $group) {
if ($group->has($identifier)) {
$group->remove($identifier);
return;
}
}
}
示例9: remove
/**
* {@inheritdoc}
*/
public function remove($key)
{
// TODO: If the keys are persistent as well (not yet implemented)
// and the collection is not initialized and orphanRemoval is
// not used we can issue a straight SQL delete/update on the
// association (table). Without initializing the collection.
$this->_initialize();
$removed = $this->_coll->remove($key);
if ($removed) {
$this->_changed();
if ($this->_association !== null && $this->_association->isOneToMany() && $this->_association->orphanRemoval) {
$this->_em->getUnitOfWork()->scheduleOrphanRemoval($removed);
}
}
return $removed;
}
示例10: remove
/**
* Remove header from collection
*
* @param string $key The case-insensitive header name
*/
public function remove($key)
{
parent::remove($this->normalizeKey($key));
}
示例11: remove
/**
* @inheritDoc
*/
public function remove($name)
{
parent::remove($this->normalizeName($name));
}
示例12: remove
/**
* @access public
* @param [type] $id [description]
* @return [type] [description]
*/
public function remove($id)
{
$id = str_replace('.', '_', $id);
unset($_SESSION[$id]);
parent::remove($id);
}