public function __construct(callable $DomainDatabaseMapFactory, IConnection $Connection, IProxyGenerator $ProxyGenerator, Functional\IReader $FunctionReader, Functional\IParser $FunctionParser, Cache\ICache $Cache) { $this->Cache = $Cache; $DomainDatabaseMap = $this->Cache->Retrieve(self::DomainDatabaseMapInstanceKey); if (!$DomainDatabaseMap instanceof \Storm\Core\Mapping\DomainDatabaseMap) { $DomainDatabaseMap = $DomainDatabaseMapFactory(); $this->Cache->Save(self::DomainDatabaseMapInstanceKey, $DomainDatabaseMap); } parent::__construct($DomainDatabaseMap, $Connection, $ProxyGenerator, $FunctionReader, $FunctionParser); }
public final function GetFromCache(Object\Identity $Identity) { $IdentityHash = $Identity->Hash(); return $this->Cache->Contains($IdentityHash) ? $this->Cache->Retrieve($IdentityHash) : null; }