本文整理匯總了PHP中google\protobuf\FieldDescriptorProto\Label::isPacked方法的典型用法代碼示例。如果您正苦於以下問題:PHP Label::isPacked方法的具體用法?PHP Label::isPacked怎麽用?PHP Label::isPacked使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類google\protobuf\FieldDescriptorProto\Label
的用法示例。
在下文中一共展示了Label::isPacked方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: printExtension
public function printExtension(Printer $printer, FieldDescriptorProto $field)
{
if (ExtensionPool::has($field->getExtendee(), $field->getNumber())) {
// NOTE: already registered.
return;
}
ExtensionPool::register($field->getExtendee(), $field->getNumber(), $field);
$printer->put("\$registry->add('`message`', `extension`, new \\ProtocolBuffers\\FieldDescriptor(array(\n", "message", Helper::getExtendeeClassName($field), "extension", $field->getNumber());
$printer->indent();
$printer->put("\"type\" => `type`,\n", "type", Helper::getFieldTypeName($field));
$printer->put("\"name\" => \"`name`\",\n", "name", $field->getName());
$printer->put("\"required\" => `required`,\n", "required", FieldDescriptorProto\Label::isRequired($field) ? "true" : "false");
$printer->put("\"optional\" => `optional`,\n", "optional", FieldDescriptorProto\Label::isOptional($field) ? "true" : "false");
$printer->put("\"repeated\" => `repeated`,\n", "repeated", FieldDescriptorProto\Label::isRepeated($field) ? "true" : "false");
$printer->put("\"packable\" => `packable`,\n", "packable", FieldDescriptorProto\Label::isPacked($field) ? "true" : "false");
$printer->put("\"default\" => `value`,\n", "value", $this->defaultValueAsString($field));
if (FieldDescriptorProto\Type::isMessage($field)) {
$name = $field->getTypeName();
$descriptor = MessagePool::get($name);
$printer->put("\"message\" => '`message`',\n", "message", Helper::getClassName($descriptor, true));
}
$printer->outdent();
$printer->put(")));\n");
}