public function isCached( Base $entity, $source = self::PERSISTED )
    {
        switch( $source ) {
            case self::PERSISTED:
                return false !== array_search( $entity, $this->instancesPersisted, true );
            case self::UNPERSISTED:
                return false !== array_search( $entity, $this->instancesUnpersisted, true );
            case self::ALL:
                return $this->isCached( $entity, self::PERSISTED ) || $this->isCached( $entity, self::UNPERSISTED );
        }
        throw new \InvalidArgumentException("Bad source `{$source}` passed to " . __FUNCTION__);
    }
public function isCached( Base $entity, $source = self::PERSISTED )
    {
        switch( $source ) {
            case self::PERSISTED:
                return false !== array_search( $entity, $this->instancesPersisted, true );
            case self::UNPERSISTED:
                return false !== array_search( $entity, $this->instancesUnpersisted, true );
            case self::ALL:
                return $this->isCached( $entity, self::PERSISTED ) || $this->isCached( $entity, self::UNPERSISTED );
        }
        throw new \InvalidArgumentException("Bad source `{$source}` passed to " . __FUNCTION__);
    }
public function isCached ( Base $ entity , $ source = self :: PERSISTED ) { switch ( $ source ) { case self :: PERSISTED : return false !== array_search ( $ entity , $ this -> instancesPersisted , true ) ; case self :: UNPERSISTED : return false !== array_search ( $ entity , $ this -> instancesUnpersisted , true ) ; case self :: ALL : return $ this -> isCached ( $ entity , self :: PERSISTED ) || $ this -> isCached ( $ entity , self :: UNPERSISTED ) ; } throw new \ InvalidArgumentException ( "Bad source `{$source}` passed to " . __FUNCTION__ ) ; }
Is this object in the multiton cache
@return bool;
Is this object in the multiton cache