Exemplo n.º 1
0
 /**
  * Gets a related entity instance from an entity set identified by a key
  * 
  * @param ResourceSet      $sourceResourceSet The entity set related to the entity to be fetched.
  * @param object           $sourceEntity      The related entity instance.
  * @param ResourceSet      $targetResourceSet The entity set from which entity needs to be fetched.
  * @param ResourceProperty $targetProperty    The metadata of the target property.
  * @param KeyDescriptor    $keyDescriptor     The key to identify the entity to be fetched.
  *
  * 
  * @return object|null Returns entity instance if found else null
  */
 public function getResourceFromRelatedResourceSet(ResourceSet $sourceResourceSet, $sourceEntity, ResourceSet $targetResourceSet, ResourceProperty $targetProperty, KeyDescriptor $keyDescriptor)
 {
     $entityInstance = $this->queryProvider->getResourceFromRelatedResourceSet($sourceResourceSet, $sourceEntity, $targetResourceSet, $targetProperty, $keyDescriptor);
     $this->_validateEntityInstance($entityInstance, $targetResourceSet, $keyDescriptor, 'IQueryProvider::getResourceFromRelatedResourceSet');
     return $entityInstance;
 }