public function setResource(ResourceInterface $resource) {
		if ($this->type === RelationshipObject::TO_MANY) {
			throw new InputException('can not set a resource on a to-many relationship, use ->addResource()');
		}
		
		$this->resource = $resource;
	}
public function setResource(ResourceInterface $resource) {
		if ($this->type === RelationshipObject::TO_MANY) {
			throw new InputException('can not set a resource on a to-many relationship, use ->addResource()');
		}
		
		$this->resource = $resource;
	}
public function setResource ( ResourceInterface $ resource ) { if ( $ this -> type === RelationshipObject :: TO_MANY ) { throw new InputException ( 'can not set a resource on a to-many relationship, use ->addResource()' ) ; } $ this -> resource = $ resource ; }
set the resource on a to-one relationship

@param ResourceInterface $resource

@throws InputException if used on a to-many relationship, use {@see ->addResource()} instead
set the resource on a to - one relationship