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

		if (isset($object->name) && ($filter === null || isset($filter['name']))) {
			foreach ($object->name instanceof \Traversable ? $object->name : (array)$object->name as $k => $v) {
				$output .= "\x12";
				$buffer = NamePartMeta::toProtobuf($v, $filter === null ? null : $filter['name']);
				$output .= Binary::encodeVarint(strlen($buffer));
				$output .= $buffer;
			}
		}

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

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

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

		if (isset($object->doubleValue) && ($filter === null || isset($filter['doubleValue']))) {
			$output .= "\x31";
			$output .= Binary::encodeDouble($object->doubleValue);
		}

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

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

		return $output;
	}