public static function toProtobuf($object, $filter = NULL)
	{
		$output = '';

		if (isset($object->namePart) && ($filter === null || isset($filter['namePart']))) {
			$output .= "\x0a";
			$output .= Binary::encodeVarint(strlen($object->namePart));
			$output .= $object->namePart;
		}

		if (isset($object->isExtension) && ($filter === null || isset($filter['isExtension']))) {
			$output .= "\x10";
			$output .= Binary::encodeVarint((int)$object->isExtension);
		}

		return $output;
	}