public function applyRelationships(Entity $owner, $data)
    {
        $this->validateData($data);
        $meta = $this->mf->getMetadataForType($owner->getType());
        foreach ($meta->getRelationships() as $key => $relationship) {
            if (!isset($data[$key]) || !$data[$key] instanceof EntityInterface) {
                continue;
            }
            $this->applyRelationship($owner, $key, $data[$key]);
        }
        return $this;
    }
public function applyRelationships(Entity $owner, $data)
    {
        $this->validateData($data);
        $meta = $this->mf->getMetadataForType($owner->getType());
        foreach ($meta->getRelationships() as $key => $relationship) {
            if (!isset($data[$key]) || !$data[$key] instanceof EntityInterface) {
                continue;
            }
            $this->applyRelationship($owner, $key, $data[$key]);
        }
        return $this;
    }
public function applyRelationships ( Entity $ owner , $ data ) { $ this -> validateData ( $ data ) ; $ meta = $ this -> mf -> getMetadataForType ( $ owner -> getType ( ) ) ; foreach ( $ meta -> getRelationships ( ) as $ key => $ relationship ) { if ( ! isset ( $ data [ $ key ] ) || ! $ data [ $ key ] instanceof EntityInterface ) { continue ; } $ this -> applyRelationship ( $ owner , $ key , $ data [ $ key ] ) ; } return $ this ; }
Applies an array or array-like set of relationship data to an entity.
Each array member must be a EntityInterface object keyed by the relationship field key.

@param   Entity              $owner      The owning entity.
@param   array|\ArrayAccess  $data       The resource data to apply.
@return  self
Applies an array or array - like set of relationship data to an entity . Each array member must be a EntityInterface object keyed by the relationship field key .