src/Data/DefaultCollection.php
public function remove($indexValue)
    {
        if (\is_object($indexValue)) {
            foreach ($this->arrCollection as $collectionIndex => $model) {
                if ($indexValue === $model) {
                    unset($this->arrCollection[$collectionIndex]);
                }
            }
        } else {
            unset($this->arrCollection[$indexValue]);
        }

        $this->arrCollection = \array_values($this->arrCollection);
    }
public function remove($indexValue)
    {
        if (\is_object($indexValue)) {
            foreach ($this->arrCollection as $collectionIndex => $model) {
                if ($indexValue === $model) {
                    unset($this->arrCollection[$collectionIndex]);
                }
            }
        } else {
            unset($this->arrCollection[$indexValue]);
        }

        $this->arrCollection = \array_values($this->arrCollection);
    }
public function remove ( $ indexValue ) { if ( \ is_object ( $ indexValue ) ) { foreach ( $ this -> arrCollection as $ collectionIndex => $ model ) { if ( $ indexValue === $ model ) { unset ( $ this -> arrCollection [ $ collectionIndex ] ) ; } } } else { unset ( $ this -> arrCollection [ $ indexValue ] ) ; } $ this -> arrCollection = \ array_values ( $ this -> arrCollection ) ; }
Remove the given index or model from the collection and renew the index.

ATTENTION: Don't use key to unset in foreach because of the new index.

@param mixed $indexValue The index (integer) or InterfaceGeneralModel instance to remove.

@return void
Remove the given index or model from the collection and renew the index .