/**
* Whether or not the item needs to be parsed and cached.
*
* @param string $schemaName
* @param string $cacheItem
* @return bool
*/
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);
}