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;

    }