/** * This function perfrom the following operations * (1) If the cache contain an entry [key, value] for the resourceset then * return the entry-value * (2) If the cache not contain an entry for the resourceset then validate * the resourceset * (a) If valid add entry as [resouceset_name, resourceSetWrapper] * (b) if not valid add entry as [resouceset_name, null] * Note: validating a resourceset means checking the resourceset is visible * or not using configuration * * @param ResourceSet $resourceSet The resourceset to validate and get the * wrapper for * * @return ResourceSetWrapper/NULL Returns an instance if ResourceSetWrapper * if resourceset is visible else NULL */ private function _validateResourceSetAndGetWrapper(ResourceSet $resourceSet) { $cacheKey = $resourceSet->getName(); if (array_key_exists($cacheKey, $this->_resourceSetWrapperCache)) { return $this->_resourceSetWrapperCache[$cacheKey]; } $this->_validateResourceType($resourceSet->getResourceType()); $resourceSetWrapper = new ResourceSetWrapper($resourceSet, $this->_configuration); if ($resourceSetWrapper->isVisible()) { $this->_resourceSetWrapperCache[$cacheKey] = $resourceSetWrapper; } else { $this->_resourceSetWrapperCache[$cacheKey] = null; } return $this->_resourceSetWrapperCache[$cacheKey]; }