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


PHP Collection::remove方法代码示例

本文整理汇总了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);
 }
开发者ID:timoxeen,项目名称:php-commerceml,代码行数:11,代码来源:CollectionTest.php

示例2: remove

 /**
  * @{@inheritdoc}
  */
 public function remove($key)
 {
     $return = parent::remove($key);
     if ($return) {
         $this->removeFromHistory($return);
     }
     return $return;
 }
开发者ID:cawaphp,项目名称:cawa,代码行数:11,代码来源:CollectionModel.php

示例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]);
     }
 }
开发者ID:robynitp,项目名称:demo-ecommerce-app,代码行数:8,代码来源:class.ProductQuantityCollection.php

示例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);
 }
开发者ID:pedrokoblitz,项目名称:maltz,代码行数:14,代码来源:CookieJar.php

示例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;
 }
开发者ID:richardmiller,项目名称:mongodb-odm,代码行数:15,代码来源:PersistentCollection.php

示例6: remove

 /**
  * @param $index
  */
 public function remove($index)
 {
     $this->discounts->remove($index);
 }
开发者ID:draperstudio,项目名称:basket,代码行数:7,代码来源:Coupon.php

示例7: testHasKeyRemoveClearIndexes

 public function testHasKeyRemoveClearIndexes()
 {
     $this->assertEquals(true, $this->collection->hasKey(3));
     $this->collection->remove(3);
     $this->assertEquals(false, $this->collection->hasKey(3));
 }
开发者ID:dtkahl,项目名称:php-array-tools,代码行数:6,代码来源:CollectionTest.php

示例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;
         }
     }
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:17,代码来源:GroupedCollection.php

示例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;
 }
开发者ID:andreia,项目名称:doctrine,代码行数:19,代码来源:PersistentCollection.php

示例10: remove

 /**
  * Remove header from collection
  *
  * @param  string $key The case-insensitive header name
  */
 public function remove($key)
 {
     parent::remove($this->normalizeKey($key));
 }
开发者ID:slimphp,项目名称:Slim-Http,代码行数:9,代码来源:Headers.php

示例11: remove

 /**
  * @inheritDoc
  */
 public function remove($name)
 {
     parent::remove($this->normalizeName($name));
 }
开发者ID:scaleddynamics,项目名称:Opulence,代码行数:7,代码来源:Headers.php

示例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);
 }
开发者ID:pedrokoblitz,项目名称:maltz,代码行数:11,代码来源:Session.php


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