public function cacheSize( $type = self::PERSISTED )
    {
        switch( $type ) {
            case self::PERSISTED:
                return count( $this->instancesPersisted );
            case self::UNPERSISTED:
                return count( $this->instancesUnpersisted );
            case self::ALL:
                return $this->cacheSize( self::PERSISTED ) + $this->cacheSize( self::UNPERSISTED );
        }
        throw new \InvalidArgumentException("Bad source `{$source}` passed to " . __FUNCTION__);
    }
public function cacheSize( $type = self::PERSISTED )
    {
        switch( $type ) {
            case self::PERSISTED:
                return count( $this->instancesPersisted );
            case self::UNPERSISTED:
                return count( $this->instancesUnpersisted );
            case self::ALL:
                return $this->cacheSize( self::PERSISTED ) + $this->cacheSize( self::UNPERSISTED );
        }
        throw new \InvalidArgumentException("Bad source `{$source}` passed to " . __FUNCTION__);
    }
public function cacheSize ( $ type = self :: PERSISTED ) { switch ( $ type ) { case self :: PERSISTED : return count ( $ this -> instancesPersisted ) ; case self :: UNPERSISTED : return count ( $ this -> instancesUnpersisted ) ; case self :: ALL : return $ this -> cacheSize ( self :: PERSISTED ) + $ this -> cacheSize ( self :: UNPERSISTED ) ; } throw new \ InvalidArgumentException ( "Bad source `{$source}` passed to " . __FUNCTION__ ) ; }
Returns the number of cached items
@return int Number of instances stored
Returns the number of cached items