示例#1
0
 /**
  * Check wrapped resource set's resource type or any of the resource type derived
  * from the this resource type has bag property associated with it.
  * 
  * @param ProvidersWrapper $provider Metadata query provider wrapper
  * 
  * @return boolean
  */
 public function hasBagProperty(ProvidersWrapper $provider)
 {
     $arrayToDetectLoop = array();
     $hasBagProperty = $this->_resourceSet->getResourceType()->hasBagProperty($arrayToDetectLoop);
     unset($arrayToDetectLoop);
     // This will check only the resource type associated with
     // the resource set, we need to check presence of bag property
     // in resource type which is derived form this resource type also.
     if (!$hasBagProperty) {
         $derivedTypes = $provider->getDerivedTypes($this->_resourceSet->getResourceType());
         foreach ($derivedTypes as $derivedType) {
             $arrayToDetectLoop = array();
             if ($derivedType->hasBagProperty($arrayToDetectLoop)) {
                 return true;
             }
         }
     }
     return false;
 }