public function remove()
    {

        $removed = 0;
        foreach( func_get_args() as $arg ){

            // is this a container?
            if( $arg instanceof Container ) {

                $originalCount = $this->count();
                $this->collection = array_diff_key( $this->collection, $arg->collection );
                $removed += ( $originalCount - $this->count() );

            } else {

                // use array search
                $search = $this->search( $arg, true );

                foreach( $search as $value ){
                    if( $value !== false ){
                        $removed++;
                        $this->offsetUnset( $value );
                    }
                }

            }

        }
        $this->rewind();
        return $removed;

    }
public function remove()
    {

        $removed = 0;
        foreach( func_get_args() as $arg ){

            // is this a container?
            if( $arg instanceof Container ) {

                $originalCount = $this->count();
                $this->collection = array_diff_key( $this->collection, $arg->collection );
                $removed += ( $originalCount - $this->count() );

            } else {

                // use array search
                $search = $this->search( $arg, true );

                foreach( $search as $value ){
                    if( $value !== false ){
                        $removed++;
                        $this->offsetUnset( $value );
                    }
                }

            }

        }
        $this->rewind();
        return $removed;

    }
public function remove ( ) { $ removed = 0 ; foreach ( func_get_args ( ) as $ arg ) { // is this a container? if ( $ arg instanceof Container ) { $ originalCount = $ this -> count ( ) ; $ this -> collection = array_diff_key ( $ this -> collection , $ arg -> collection ) ; $ removed += ( $ originalCount - $ this -> count ( ) ) ; } else { // use array search $ search = $ this -> search ( $ arg , true ) ; foreach ( $ search as $ value ) { if ( $ value !== false ) { $ removed ++ ; $ this -> offsetUnset ( $ value ) ; } } } } $ this -> rewind ( ) ; return $ removed ; }
Remove entities from collection
@param ContainerableInterface|Container|ContainerableInterface[]
@return int Number removed
Remove entities from collection