/**
  * @test Collection::remove()
  */
 public function testRemove()
 {
     $this->buildEnvironment();
     $expect = $this->source;
     unset($expect['a1']);
     $result = $this->collection->remove('a1')->fetch();
     $this->assertEquals($expect, $result);
 }
Example #2
0
 /**
  * @{@inheritdoc}
  */
 public function remove($key)
 {
     $return = parent::remove($key);
     if ($return) {
         $this->removeFromHistory($return);
     }
     return $return;
 }
 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]);
     }
 }
Example #4
0
 /**
  * /
  * @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);
 }
 /**
  * {@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;
 }
Example #6
0
 /**
  * @param $index
  */
 public function remove($index)
 {
     $this->discounts->remove($index);
 }
 public function testHasKeyRemoveClearIndexes()
 {
     $this->assertEquals(true, $this->collection->hasKey(3));
     $this->collection->remove(3);
     $this->assertEquals(false, $this->collection->hasKey(3));
 }
 /**
  * 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;
         }
     }
 }
 /**
  * {@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;
 }
Example #10
0
 /**
  * Remove header from collection
  *
  * @param  string $key The case-insensitive header name
  */
 public function remove($key)
 {
     parent::remove($this->normalizeKey($key));
 }
Example #11
0
 /**
  * @inheritDoc
  */
 public function remove($name)
 {
     parent::remove($this->normalizeName($name));
 }
Example #12
0
 /**
  * @access public
  * @param  [type] $id [description]
  * @return [type]     [description]
  */
 public function remove($id)
 {
     $id = str_replace('.', '_', $id);
     unset($_SESSION[$id]);
     parent::remove($id);
 }