public function addRelationshipObject($key, RelationshipObject $relationshipObject, array $options=[]) {
		$this->ensureResourceObject();
		
		$options = array_merge(self::$defaults, $options);
		
		$this->resource->addRelationshipObject($key, $relationshipObject);
		
		if ($options['includeContainedResources']) {
			$this->addIncludedResourceObject(...$relationshipObject->getNestedContainedResourceObjects());
		}
	}
public function addRelationshipObject($key, RelationshipObject $relationshipObject, array $options=[]) {
		$this->ensureResourceObject();
		
		$options = array_merge(self::$defaults, $options);
		
		$this->resource->addRelationshipObject($key, $relationshipObject);
		
		if ($options['includeContainedResources']) {
			$this->addIncludedResourceObject(...$relationshipObject->getNestedContainedResourceObjects());
		}
	}
public function addRelationshipObject ( $ key , RelationshipObject $ relationshipObject , array $ options = [ ] ) { $ this -> ensureResourceObject ( ) ; $ options = array_merge ( self :: $ defaults , $ options ) ; $ this -> resource -> addRelationshipObject ( $ key , $ relationshipObject ) ; if ( $ options [ 'includeContainedResources' ] ) { $ this -> addIncludedResourceObject ( ... $ relationshipObject -> getNestedContainedResourceObjects ( ) ) ; } }
add a RelationshipObject to the resource

adds included resources if found inside the RelationshipObject, unless $options['includeContainedResources'] is set to false

@param string             $key
@param RelationshipObject $relationshipObject
@param array              $options            optional {@see ResourceDocument::$defaults}
add a RelationshipObject to the resource