LdapTools\Factory\LdapObjectSchemaFactory::shouldBuildCacheItem PHP Method

shouldBuildCacheItem() protected method

Whether or not the item needs to be parsed and cached.
protected shouldBuildCacheItem ( string $schemaName, string $cacheItem ) : boolean
$schemaName string
$cacheItem string
return boolean
    protected function shouldBuildCacheItem($schemaName, $cacheItem)
    {
        $cacheOutOfDate = false;
        if ($this->cache->getUseAutoCache()) {
            $lastModTime = $this->parser->getSchemaModificationTime($schemaName);
            $cacheCreationTime = $this->cache->getCacheCreationTime(LdapObjectSchema::getCacheType(), $cacheItem);
            $cacheOutOfDate = !$lastModTime || $lastModTime > $cacheCreationTime;
        }
        return $cacheOutOfDate || !$this->cache->contains(LdapObjectSchema::getCacheType(), $cacheItem);
    }