public function detach( Base $entity, &$detachedFrom = null )
    {

        $detachedFrom = null;

        foreach( array( 'Persisted', 'Unpersisted') as $type ) {

            $cache = "instances{$type}";
            $cache =& $this->$cache;

            if( false !== $key = array_search( $entity, $cache, true ) ) {
                unset( $cache[$key] );
                $detachedFrom = $this->constantGet( strtoupper( $type ) );
                return true;
            }

            unset( $cache );

        }

        return false;

    }
public function detach( Base $entity, &$detachedFrom = null )
    {

        $detachedFrom = null;

        foreach( array( 'Persisted', 'Unpersisted') as $type ) {

            $cache = "instances{$type}";
            $cache =& $this->$cache;

            if( false !== $key = array_search( $entity, $cache, true ) ) {
                unset( $cache[$key] );
                $detachedFrom = $this->constantGet( strtoupper( $type ) );
                return true;
            }

            unset( $cache );

        }

        return false;

    }
public function detach ( Base $ entity , & $ detachedFrom = null ) { $ detachedFrom = null ; foreach ( array ( 'Persisted' , 'Unpersisted' ) as $ type ) { $ cache = "instances{$type}" ; $ cache = & $ this -> $ cache ; if ( false !== $ key = array_search ( $ entity , $ cache , true ) ) { unset ( $ cache [ $ key ] ) ; $ detachedFrom = $ this -> constantGet ( strtoupper ( $ type ) ) ; return true ; } unset ( $ cache ) ; } return false ; }
Detach a entity from the multiton
@param Entity\Base
@return bool Successful detachement?
Detach a entity from the multiton