public function equals(CollectionInterface $collection) { if ($collection->count() !== $this->count()) { return false; } foreach ($collection as $key => $item) { if ($this->_collection[$key] !== $item) { return false; } } return true; }
/** * Get number of ocurrences. * @return int */ public function count() { return $this->collection->count(); }