library/Haste/Model/Model.php
public static function removeModelFromCollection(\Model $objModel, \Model\Collection $objCollection = null)
    {
        $arrRegistered = [];

        if ($objCollection !== null)
        {
            while ($objCollection->next())
            {
                if ($objCollection->getTable() !== $objModel->getTable)
                {
                    return $objCollection;
                }

                $intId = $objCollection->{$objModel::getPk()};

                if ($objModel->{$objModel::getPk()} == $intId)
                {
                    continue;
                }

                $arrRegistered[$intId] = $objCollection->current();
            }
        }

        return static::createCollection(array_filter(array_values($arrRegistered)), $objModel->getTable());
    }
public static function removeModelFromCollection(\Model $objModel, \Model\Collection $objCollection = null)
    {
        $arrRegistered = [];

        if ($objCollection !== null)
        {
            while ($objCollection->next())
            {
                if ($objCollection->getTable() !== $objModel->getTable)
                {
                    return $objCollection;
                }

                $intId = $objCollection->{$objModel::getPk()};

                if ($objModel->{$objModel::getPk()} == $intId)
                {
                    continue;
                }

                $arrRegistered[$intId] = $objCollection->current();
            }
        }

        return static::createCollection(array_filter(array_values($arrRegistered)), $objModel->getTable());
    }
public static function removeModelFromCollection ( \ Model $ objModel , \ Model \ Collection $ objCollection = null ) { $ arrRegistered = [ ] ; if ( $ objCollection !== null ) { while ( $ objCollection -> next ( ) ) { if ( $ objCollection -> getTable ( ) !== $ objModel -> getTable ) { return $ objCollection ; } $ intId = $ objCollection -> { $ objModel :: getPk ( ) } ; if ( $ objModel -> { $ objModel :: getPk ( ) } == $ intId ) { continue ; } $ arrRegistered [ $ intId ] = $ objCollection -> current ( ) ; } } return static :: createCollection ( array_filter ( array_values ( $ arrRegistered ) ) , $ objModel -> getTable ( ) ) ; }
Remove a model from a collection

@param \Model                 $objModel
@param \Model\Collection|null $objCollection

@return \Model\Collection|null
Remove a model from a collection