Remove the collection

@param  Collection $collection
@return bool
339133
protected function removeCollection(Collection $collection) {
		$transaction = $this->getTransactionsManager()->get(true);
			
		foreach ($collection as $model) {
			$phalconModel = $this->createTableModel($model);
			$phalconModel->setTransaction($transaction);

			if (! $phalconModel->delete()) {
				$transaction->rollback();
			}
		}

		$transaction->commit();
		return true;
	}
957988
public function desc(array $collection)
    {
        $this->changeDirection(false);
        $collection = $this->asc($collection);
        $this->changeDirection(true);
        return $collection;
    }
348378
private function _collection($collection) {
    return (!is_array($collection) && !is_object($collection)) ? str_split((string) $collection) : $collection;
  }
686032
public function dropCollection($collection)
    {
        $this->beginProfile($token = "    > drop collection " . $this->composeCollectionLogName($collection) . " ...");
        $this->db->getCollection($collection)->drop();
        $this->endProfile($token);
    }
197564
public function forget($collection)
    {
        $collection = $this->getCollectionNameFromInstance($collection);

        if ($this->has($collection))
        {
            $this->dirty = true;

            unset($this->entries[$collection]);
        }
    }
576333
private function forgetCollection(Collection $collection)
    {
        $query_builder = $this->manager->createQueryBuilder();
        $query_builder
            ->delete(StackUsageRecord::class, 'r')
            ->where('r.collection_id = :collection_id')
            ->setParameter('collection_id', $collection->getCollectionID())
            ->getQuery()->execute();
    }
353570
public function delete($key)
    {
        if ($this->has($key)) {
            unset($this->collection[$key]);
            return true;
        }
        return false;
    }
679859
def delete(self):
        """"""
        if not self.id:
            return
        self.collection.remove({'_id': self._id})
        self.on_delete(self)
841032
public function renumberCollection(Collection $collection)
    {
        $i = 0;

        foreach ( $collection as $item ) {
            if ( $item instanceof NumericallySortableContract ) {
                $item->updateSortingOrder(++$i);
            }
        }

        return $this;
    }
656373
@SuppressWarnings("unchecked")
	public static <T> Collection<T> removeAny(Collection<T> collection, T... elesRemoved) {
		collection.removeAll(newHashSet(elesRemoved));
		return collection;
	}
825791
public function deleteVolumePricings($collection)
	{
		$timeStamp = time();
		if (!is_array($collection)) {
			return $this->createException('InvalidParameterValueException', 'Invalid parameter value. Parameter must be an array collection', 'E:S:001');
		}
		$countDeleted = 0;
		foreach ($collection as $entry) {
			if ($entry instanceof BundleEntity\VolumePricing) {
				$this->em->remove($entry);
				$countDeleted++;
			} else {
				$response = $this->getVolumePricing($entry);
				if (!$response->error->exist) {
					$this->em->remove($response->result->set);
					$countDeleted++;
				}
			}
		}
		if ($countDeleted < 0) {
			return new ModelResponse(null, 0, 0, null, true, 'E:E:001', 'Unable to delete all or some of the selected entries.', $timeStamp, time());
		}
		$this->em->flush();
		return new ModelResponse(null, 0, 0, null, false, 'S:D:001', 'Selected entries have been successfully removed from database.', $timeStamp, time());
	}
1171602
public function delete()
    {
        if (!$this->isNew()) {
            $this->_collection->remove(['_id' => $this->_id]);
            $this->_cache->delete(static::getCollection()."_{$this->_id}");
            return true;
        }
        return false;
    }
366375
public function remove($id)
    {
        if ($this->has($id) === false) {
            return;
        }

        $collection = $this->idCollections[$id];

        unset($this->idCollections[$id]);
        unset($this->itemCollections[$collection]);
        unset($this->items[$id]);
    }
95843
public function executeDelete(MongoCollection $collection, Query $query) {
        $where = $this->formatWhere($query->getWhere());

        $query->attribute('justOne', ($query->getLimit() == 1));

        $response = $collection->remove($where, $query->getAttributes() + ['w' => 1]);
        $response['params'] = [
            'where' => $where
        ];

        return $response;
    }
729238
public function removeCollection($id)
    {
        unset($this->_collections[$id]);
        $this->clearSchema();

        $this->getLogger()->debug('Collection removed', array('collection' => $id));

        return $this;
    }
224449
protected function postCollectionModifiers(Collection $collection)
    {
        if ($this->getOrderByField() && $this->getOrderByDirection()) {
            $field = $this->getOrderByField();
            $desc  = false;

            if ($this->getOrderByDirection() === 'desc') {
                $desc = true;
            }

            $sorted = $collection->sortBy(function ($entry) use ($field) {
                if (property_exists($entry, $field)) {
                    return $entry->{$field};
                }
            }, SORT_NATURAL, $desc);

            return $sorted;
        }

        return $collection;
    }
434353
public function removeElement($element)
    {
        if (!$this->hasElement($element)) {
            return false;
        }

        $totalCollection = $this->count();
        $key             = $this->indexOf($element);

        unset($this->collections[$key]);

        return $this->count() !== $totalCollection;
    }