public static function fromAnything($relation, array $links=[], array $meta=[]) {
		if (is_array($relation)) {
			$relation = CollectionDocument::fromResources(...$relation);
		}
		
		if ($relation instanceof ResourceInterface) {
			$relationshipObject = self::fromResource($relation, $links, $meta);
		}
		elseif ($relation instanceof CollectionDocument) {
			$relationshipObject = self::fromCollectionDocument($relation, $links, $meta);
		}
		elseif ($relation === null) {
			$relationshipObject = new RelationshipObject(RelationshipObject::TO_ONE);
		}
		else {
			throw new InputException('unknown format of relation "'.gettype($relation).'"');
		}
		
		return $relationshipObject;
	}