repo stringlengths 6 63 | path stringlengths 5 140 | func_name stringlengths 3 151 | original_string stringlengths 84 13k | language stringclasses 1
value | code stringlengths 84 13k | code_tokens list | docstring stringlengths 3 47.2k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 91 247 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
api-platform/core | src/Metadata/Resource/ResourceMetadata.php | ResourceMetadata.withShortName | public function withShortName(string $shortName): self
{
$metadata = clone $this;
$metadata->shortName = $shortName;
return $metadata;
} | php | public function withShortName(string $shortName): self
{
$metadata = clone $this;
$metadata->shortName = $shortName;
return $metadata;
} | [
"public",
"function",
"withShortName",
"(",
"string",
"$",
"shortName",
")",
":",
"self",
"{",
"$",
"metadata",
"=",
"clone",
"$",
"this",
";",
"$",
"metadata",
"->",
"shortName",
"=",
"$",
"shortName",
";",
"return",
"$",
"metadata",
";",
"}"
] | Returns a new instance with the given short name. | [
"Returns",
"a",
"new",
"instance",
"with",
"the",
"given",
"short",
"name",
"."
] | 0888bf33429a37d031345bf7c720f23010a50de4 | https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Metadata/Resource/ResourceMetadata.php#L57-L63 | train |
api-platform/core | src/Metadata/Resource/ResourceMetadata.php | ResourceMetadata.withIri | public function withIri(string $iri): self
{
$metadata = clone $this;
$metadata->iri = $iri;
return $metadata;
} | php | public function withIri(string $iri): self
{
$metadata = clone $this;
$metadata->iri = $iri;
return $metadata;
} | [
"public",
"function",
"withIri",
"(",
"string",
"$",
"iri",
")",
":",
"self",
"{",
"$",
"metadata",
"=",
"clone",
"$",
"this",
";",
"$",
"metadata",
"->",
"iri",
"=",
"$",
"iri",
";",
"return",
"$",
"metadata",
";",
"}"
] | Returns a new instance with the given IRI. | [
"Returns",
"a",
"new",
"instance",
"with",
"the",
"given",
"IRI",
"."
] | 0888bf33429a37d031345bf7c720f23010a50de4 | https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Metadata/Resource/ResourceMetadata.php#L95-L101 | train |
api-platform/core | src/Metadata/Resource/ResourceMetadata.php | ResourceMetadata.getCollectionOperationAttribute | public function getCollectionOperationAttribute(?string $operationName, string $key, $defaultValue = null, bool $resourceFallback = false)
{
return $this->findOperationAttribute($this->collectionOperations, $operationName, $key, $defaultValue, $resourceFallback);
} | php | public function getCollectionOperationAttribute(?string $operationName, string $key, $defaultValue = null, bool $resourceFallback = false)
{
return $this->findOperationAttribute($this->collectionOperations, $operationName, $key, $defaultValue, $resourceFallback);
} | [
"public",
"function",
"getCollectionOperationAttribute",
"(",
"?",
"string",
"$",
"operationName",
",",
"string",
"$",
"key",
",",
"$",
"defaultValue",
"=",
"null",
",",
"bool",
"$",
"resourceFallback",
"=",
"false",
")",
"{",
"return",
"$",
"this",
"->",
"f... | Gets a collection operation attribute, optionally fallback to a resource attribute.
@param mixed|null $defaultValue | [
"Gets",
"a",
"collection",
"operation",
"attribute",
"optionally",
"fallback",
"to",
"a",
"resource",
"attribute",
"."
] | 0888bf33429a37d031345bf7c720f23010a50de4 | https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Metadata/Resource/ResourceMetadata.php#L165-L168 | train |
api-platform/core | src/Metadata/Resource/ResourceMetadata.php | ResourceMetadata.getItemOperationAttribute | public function getItemOperationAttribute(?string $operationName, string $key, $defaultValue = null, bool $resourceFallback = false)
{
return $this->findOperationAttribute($this->itemOperations, $operationName, $key, $defaultValue, $resourceFallback);
} | php | public function getItemOperationAttribute(?string $operationName, string $key, $defaultValue = null, bool $resourceFallback = false)
{
return $this->findOperationAttribute($this->itemOperations, $operationName, $key, $defaultValue, $resourceFallback);
} | [
"public",
"function",
"getItemOperationAttribute",
"(",
"?",
"string",
"$",
"operationName",
",",
"string",
"$",
"key",
",",
"$",
"defaultValue",
"=",
"null",
",",
"bool",
"$",
"resourceFallback",
"=",
"false",
")",
"{",
"return",
"$",
"this",
"->",
"findOpe... | Gets an item operation attribute, optionally fallback to a resource attribute.
@param mixed|null $defaultValue | [
"Gets",
"an",
"item",
"operation",
"attribute",
"optionally",
"fallback",
"to",
"a",
"resource",
"attribute",
"."
] | 0888bf33429a37d031345bf7c720f23010a50de4 | https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Metadata/Resource/ResourceMetadata.php#L175-L178 | train |
api-platform/core | src/Metadata/Resource/ResourceMetadata.php | ResourceMetadata.getSubresourceOperationAttribute | public function getSubresourceOperationAttribute(?string $operationName, string $key, $defaultValue = null, bool $resourceFallback = false)
{
return $this->findOperationAttribute($this->subresourceOperations, $operationName, $key, $defaultValue, $resourceFallback);
} | php | public function getSubresourceOperationAttribute(?string $operationName, string $key, $defaultValue = null, bool $resourceFallback = false)
{
return $this->findOperationAttribute($this->subresourceOperations, $operationName, $key, $defaultValue, $resourceFallback);
} | [
"public",
"function",
"getSubresourceOperationAttribute",
"(",
"?",
"string",
"$",
"operationName",
",",
"string",
"$",
"key",
",",
"$",
"defaultValue",
"=",
"null",
",",
"bool",
"$",
"resourceFallback",
"=",
"false",
")",
"{",
"return",
"$",
"this",
"->",
"... | Gets a subresource operation attribute, optionally fallback to a resource attribute.
@param mixed|null $defaultValue | [
"Gets",
"a",
"subresource",
"operation",
"attribute",
"optionally",
"fallback",
"to",
"a",
"resource",
"attribute",
"."
] | 0888bf33429a37d031345bf7c720f23010a50de4 | https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Metadata/Resource/ResourceMetadata.php#L185-L188 | train |
api-platform/core | src/Metadata/Resource/ResourceMetadata.php | ResourceMetadata.getTypedOperationAttribute | public function getTypedOperationAttribute(string $operationType, string $operationName, string $key, $defaultValue = null, bool $resourceFallback = false)
{
switch ($operationType) {
case OperationType::COLLECTION:
return $this->getCollectionOperationAttribute($operationName, $k... | php | public function getTypedOperationAttribute(string $operationType, string $operationName, string $key, $defaultValue = null, bool $resourceFallback = false)
{
switch ($operationType) {
case OperationType::COLLECTION:
return $this->getCollectionOperationAttribute($operationName, $k... | [
"public",
"function",
"getTypedOperationAttribute",
"(",
"string",
"$",
"operationType",
",",
"string",
"$",
"operationName",
",",
"string",
"$",
"key",
",",
"$",
"defaultValue",
"=",
"null",
",",
"bool",
"$",
"resourceFallback",
"=",
"false",
")",
"{",
"switc... | Gets an attribute for a given operation type and operation name.
@param mixed|null $defaultValue | [
"Gets",
"an",
"attribute",
"for",
"a",
"given",
"operation",
"type",
"and",
"operation",
"name",
"."
] | 0888bf33429a37d031345bf7c720f23010a50de4 | https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Metadata/Resource/ResourceMetadata.php#L234-L244 | train |
api-platform/core | src/Metadata/Resource/ResourceMetadata.php | ResourceMetadata.findOperationAttribute | private function findOperationAttribute(?array $operations, ?string $operationName, string $key, $defaultValue, bool $resourceFallback)
{
if (null !== $operationName && isset($operations[$operationName][$key])) {
return $operations[$operationName][$key];
}
if ($resourceFallback ... | php | private function findOperationAttribute(?array $operations, ?string $operationName, string $key, $defaultValue, bool $resourceFallback)
{
if (null !== $operationName && isset($operations[$operationName][$key])) {
return $operations[$operationName][$key];
}
if ($resourceFallback ... | [
"private",
"function",
"findOperationAttribute",
"(",
"?",
"array",
"$",
"operations",
",",
"?",
"string",
"$",
"operationName",
",",
"string",
"$",
"key",
",",
"$",
"defaultValue",
",",
"bool",
"$",
"resourceFallback",
")",
"{",
"if",
"(",
"null",
"!==",
... | Gets an operation attribute, optionally fallback to a resource attribute.
@param mixed|null $defaultValue | [
"Gets",
"an",
"operation",
"attribute",
"optionally",
"fallback",
"to",
"a",
"resource",
"attribute",
"."
] | 0888bf33429a37d031345bf7c720f23010a50de4 | https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Metadata/Resource/ResourceMetadata.php#L299-L310 | train |
api-platform/core | src/Hydra/Serializer/DocumentationNormalizer.php | DocumentationNormalizer.populateEntrypointProperties | private function populateEntrypointProperties(string $resourceClass, ResourceMetadata $resourceMetadata, string $shortName, string $prefixedShortName, array &$entrypointProperties)
{
$hydraCollectionOperations = $this->getHydraOperations($resourceClass, $resourceMetadata, $prefixedShortName, true);
... | php | private function populateEntrypointProperties(string $resourceClass, ResourceMetadata $resourceMetadata, string $shortName, string $prefixedShortName, array &$entrypointProperties)
{
$hydraCollectionOperations = $this->getHydraOperations($resourceClass, $resourceMetadata, $prefixedShortName, true);
... | [
"private",
"function",
"populateEntrypointProperties",
"(",
"string",
"$",
"resourceClass",
",",
"ResourceMetadata",
"$",
"resourceMetadata",
",",
"string",
"$",
"shortName",
",",
"string",
"$",
"prefixedShortName",
",",
"array",
"&",
"$",
"entrypointProperties",
")",... | Populates entrypoint properties. | [
"Populates",
"entrypoint",
"properties",
"."
] | 0888bf33429a37d031345bf7c720f23010a50de4 | https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Hydra/Serializer/DocumentationNormalizer.php#L88-L123 | train |
api-platform/core | src/Hydra/Serializer/DocumentationNormalizer.php | DocumentationNormalizer.getClass | private function getClass(string $resourceClass, ResourceMetadata $resourceMetadata, string $shortName, string $prefixedShortName, array $context): array
{
$class = [
'@id' => $prefixedShortName,
'@type' => 'hydra:Class',
'rdfs:label' => $shortName,
'hydra:tit... | php | private function getClass(string $resourceClass, ResourceMetadata $resourceMetadata, string $shortName, string $prefixedShortName, array $context): array
{
$class = [
'@id' => $prefixedShortName,
'@type' => 'hydra:Class',
'rdfs:label' => $shortName,
'hydra:tit... | [
"private",
"function",
"getClass",
"(",
"string",
"$",
"resourceClass",
",",
"ResourceMetadata",
"$",
"resourceMetadata",
",",
"string",
"$",
"shortName",
",",
"string",
"$",
"prefixedShortName",
",",
"array",
"$",
"context",
")",
":",
"array",
"{",
"$",
"clas... | Gets a Hydra class. | [
"Gets",
"a",
"Hydra",
"class",
"."
] | 0888bf33429a37d031345bf7c720f23010a50de4 | https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Hydra/Serializer/DocumentationNormalizer.php#L128-L148 | train |
api-platform/core | src/Hydra/Serializer/DocumentationNormalizer.php | DocumentationNormalizer.getPropertyNameCollectionFactoryContext | private function getPropertyNameCollectionFactoryContext(ResourceMetadata $resourceMetadata): array
{
$attributes = $resourceMetadata->getAttributes();
$context = [];
if (isset($attributes['normalization_context'][AbstractNormalizer::GROUPS])) {
$context['serializer_groups'] = (... | php | private function getPropertyNameCollectionFactoryContext(ResourceMetadata $resourceMetadata): array
{
$attributes = $resourceMetadata->getAttributes();
$context = [];
if (isset($attributes['normalization_context'][AbstractNormalizer::GROUPS])) {
$context['serializer_groups'] = (... | [
"private",
"function",
"getPropertyNameCollectionFactoryContext",
"(",
"ResourceMetadata",
"$",
"resourceMetadata",
")",
":",
"array",
"{",
"$",
"attributes",
"=",
"$",
"resourceMetadata",
"->",
"getAttributes",
"(",
")",
";",
"$",
"context",
"=",
"[",
"]",
";",
... | Gets the context for the property name factory. | [
"Gets",
"the",
"context",
"for",
"the",
"property",
"name",
"factory",
"."
] | 0888bf33429a37d031345bf7c720f23010a50de4 | https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Hydra/Serializer/DocumentationNormalizer.php#L153-L177 | train |
api-platform/core | src/Hydra/Serializer/DocumentationNormalizer.php | DocumentationNormalizer.getHydraProperties | private function getHydraProperties(string $resourceClass, ResourceMetadata $resourceMetadata, string $shortName, string $prefixedShortName, array $context): array
{
$classes = [];
foreach ($resourceMetadata->getCollectionOperations() as $operationName => $operation) {
$inputMetadata = $... | php | private function getHydraProperties(string $resourceClass, ResourceMetadata $resourceMetadata, string $shortName, string $prefixedShortName, array $context): array
{
$classes = [];
foreach ($resourceMetadata->getCollectionOperations() as $operationName => $operation) {
$inputMetadata = $... | [
"private",
"function",
"getHydraProperties",
"(",
"string",
"$",
"resourceClass",
",",
"ResourceMetadata",
"$",
"resourceMetadata",
",",
"string",
"$",
"shortName",
",",
"string",
"$",
"prefixedShortName",
",",
"array",
"$",
"context",
")",
":",
"array",
"{",
"$... | Gets Hydra properties. | [
"Gets",
"Hydra",
"properties",
"."
] | 0888bf33429a37d031345bf7c720f23010a50de4 | https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Hydra/Serializer/DocumentationNormalizer.php#L182-L214 | train |
api-platform/core | src/Hydra/Serializer/DocumentationNormalizer.php | DocumentationNormalizer.getHydraOperations | private function getHydraOperations(string $resourceClass, ResourceMetadata $resourceMetadata, string $prefixedShortName, bool $collection): array
{
if (null === $operations = $collection ? $resourceMetadata->getCollectionOperations() : $resourceMetadata->getItemOperations()) {
return [];
... | php | private function getHydraOperations(string $resourceClass, ResourceMetadata $resourceMetadata, string $prefixedShortName, bool $collection): array
{
if (null === $operations = $collection ? $resourceMetadata->getCollectionOperations() : $resourceMetadata->getItemOperations()) {
return [];
... | [
"private",
"function",
"getHydraOperations",
"(",
"string",
"$",
"resourceClass",
",",
"ResourceMetadata",
"$",
"resourceMetadata",
",",
"string",
"$",
"prefixedShortName",
",",
"bool",
"$",
"collection",
")",
":",
"array",
"{",
"if",
"(",
"null",
"===",
"$",
... | Gets Hydra operations. | [
"Gets",
"Hydra",
"operations",
"."
] | 0888bf33429a37d031345bf7c720f23010a50de4 | https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Hydra/Serializer/DocumentationNormalizer.php#L219-L239 | train |
api-platform/core | src/Hydra/Serializer/DocumentationNormalizer.php | DocumentationNormalizer.getRange | private function getRange(PropertyMetadata $propertyMetadata): ?string
{
$jsonldContext = $propertyMetadata->getAttributes()['jsonld_context'] ?? [];
if (isset($jsonldContext['@type'])) {
return $jsonldContext['@type'];
}
if (null === $type = $propertyMetadata->getType(... | php | private function getRange(PropertyMetadata $propertyMetadata): ?string
{
$jsonldContext = $propertyMetadata->getAttributes()['jsonld_context'] ?? [];
if (isset($jsonldContext['@type'])) {
return $jsonldContext['@type'];
}
if (null === $type = $propertyMetadata->getType(... | [
"private",
"function",
"getRange",
"(",
"PropertyMetadata",
"$",
"propertyMetadata",
")",
":",
"?",
"string",
"{",
"$",
"jsonldContext",
"=",
"$",
"propertyMetadata",
"->",
"getAttributes",
"(",
")",
"[",
"'jsonld_context'",
"]",
"??",
"[",
"]",
";",
"if",
"... | Gets the range of the property. | [
"Gets",
"the",
"range",
"of",
"the",
"property",
"."
] | 0888bf33429a37d031345bf7c720f23010a50de4 | https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Hydra/Serializer/DocumentationNormalizer.php#L328-L371 | train |
api-platform/core | src/Hydra/Serializer/DocumentationNormalizer.php | DocumentationNormalizer.getClasses | private function getClasses(array $entrypointProperties, array $classes): array
{
$classes[] = [
'@id' => '#Entrypoint',
'@type' => 'hydra:Class',
'hydra:title' => 'The API entrypoint',
'hydra:supportedProperty' => $entrypointProperties,
'hydra:sup... | php | private function getClasses(array $entrypointProperties, array $classes): array
{
$classes[] = [
'@id' => '#Entrypoint',
'@type' => 'hydra:Class',
'hydra:title' => 'The API entrypoint',
'hydra:supportedProperty' => $entrypointProperties,
'hydra:sup... | [
"private",
"function",
"getClasses",
"(",
"array",
"$",
"entrypointProperties",
",",
"array",
"$",
"classes",
")",
":",
"array",
"{",
"$",
"classes",
"[",
"]",
"=",
"[",
"'@id'",
"=>",
"'#Entrypoint'",
",",
"'@type'",
"=>",
"'hydra:Class'",
",",
"'hydra:titl... | Builds the classes array. | [
"Builds",
"the",
"classes",
"array",
"."
] | 0888bf33429a37d031345bf7c720f23010a50de4 | https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Hydra/Serializer/DocumentationNormalizer.php#L376-L453 | train |
api-platform/core | src/Hydra/Serializer/DocumentationNormalizer.php | DocumentationNormalizer.getProperty | private function getProperty(PropertyMetadata $propertyMetadata, string $propertyName, string $prefixedShortName, string $shortName): array
{
$propertyData = [
'@id' => $propertyMetadata->getIri() ?? "#$shortName/$propertyName",
'@type' => $propertyMetadata->isReadableLink() ? 'rdf:P... | php | private function getProperty(PropertyMetadata $propertyMetadata, string $propertyName, string $prefixedShortName, string $shortName): array
{
$propertyData = [
'@id' => $propertyMetadata->getIri() ?? "#$shortName/$propertyName",
'@type' => $propertyMetadata->isReadableLink() ? 'rdf:P... | [
"private",
"function",
"getProperty",
"(",
"PropertyMetadata",
"$",
"propertyMetadata",
",",
"string",
"$",
"propertyName",
",",
"string",
"$",
"prefixedShortName",
",",
"string",
"$",
"shortName",
")",
":",
"array",
"{",
"$",
"propertyData",
"=",
"[",
"'@id'",
... | Gets a property definition. | [
"Gets",
"a",
"property",
"definition",
"."
] | 0888bf33429a37d031345bf7c720f23010a50de4 | https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Hydra/Serializer/DocumentationNormalizer.php#L458-L495 | train |
api-platform/core | src/Hydra/Serializer/DocumentationNormalizer.php | DocumentationNormalizer.computeDoc | private function computeDoc(Documentation $object, array $classes): array
{
$doc = ['@context' => $this->getContext(), '@id' => $this->urlGenerator->generate('api_doc', ['_format' => self::FORMAT]), '@type' => 'hydra:ApiDocumentation'];
if ('' !== $object->getTitle()) {
$doc['hydra:titl... | php | private function computeDoc(Documentation $object, array $classes): array
{
$doc = ['@context' => $this->getContext(), '@id' => $this->urlGenerator->generate('api_doc', ['_format' => self::FORMAT]), '@type' => 'hydra:ApiDocumentation'];
if ('' !== $object->getTitle()) {
$doc['hydra:titl... | [
"private",
"function",
"computeDoc",
"(",
"Documentation",
"$",
"object",
",",
"array",
"$",
"classes",
")",
":",
"array",
"{",
"$",
"doc",
"=",
"[",
"'@context'",
"=>",
"$",
"this",
"->",
"getContext",
"(",
")",
",",
"'@id'",
"=>",
"$",
"this",
"->",
... | Computes the documentation. | [
"Computes",
"the",
"documentation",
"."
] | 0888bf33429a37d031345bf7c720f23010a50de4 | https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Hydra/Serializer/DocumentationNormalizer.php#L500-L516 | train |
api-platform/core | src/Hydra/Serializer/DocumentationNormalizer.php | DocumentationNormalizer.getContext | private function getContext(): array
{
return [
'@vocab' => $this->urlGenerator->generate('api_doc', ['_format' => self::FORMAT], UrlGeneratorInterface::ABS_URL).'#',
'hydra' => ContextBuilderInterface::HYDRA_NS,
'rdf' => ContextBuilderInterface::RDF_NS,
'rdfs... | php | private function getContext(): array
{
return [
'@vocab' => $this->urlGenerator->generate('api_doc', ['_format' => self::FORMAT], UrlGeneratorInterface::ABS_URL).'#',
'hydra' => ContextBuilderInterface::HYDRA_NS,
'rdf' => ContextBuilderInterface::RDF_NS,
'rdfs... | [
"private",
"function",
"getContext",
"(",
")",
":",
"array",
"{",
"return",
"[",
"'@vocab'",
"=>",
"$",
"this",
"->",
"urlGenerator",
"->",
"generate",
"(",
"'api_doc'",
",",
"[",
"'_format'",
"=>",
"self",
"::",
"FORMAT",
"]",
",",
"UrlGeneratorInterface",
... | Builds the JSON-LD context for the API documentation. | [
"Builds",
"the",
"JSON",
"-",
"LD",
"context",
"for",
"the",
"API",
"documentation",
"."
] | 0888bf33429a37d031345bf7c720f23010a50de4 | https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Hydra/Serializer/DocumentationNormalizer.php#L521-L537 | train |
api-platform/core | src/Bridge/Elasticsearch/DataProvider/Filter/AbstractSearchFilter.php | AbstractSearchFilter.isIdentifier | protected function isIdentifier(string $resourceClass, string $property): bool
{
return $property === $this->identifierExtractor->getIdentifierFromResourceClass($resourceClass);
} | php | protected function isIdentifier(string $resourceClass, string $property): bool
{
return $property === $this->identifierExtractor->getIdentifierFromResourceClass($resourceClass);
} | [
"protected",
"function",
"isIdentifier",
"(",
"string",
"$",
"resourceClass",
",",
"string",
"$",
"property",
")",
":",
"bool",
"{",
"return",
"$",
"property",
"===",
"$",
"this",
"->",
"identifierExtractor",
"->",
"getIdentifierFromResourceClass",
"(",
"$",
"re... | Is the given property of the given resource class an identifier? | [
"Is",
"the",
"given",
"property",
"of",
"the",
"given",
"resource",
"class",
"an",
"identifier?"
] | 0888bf33429a37d031345bf7c720f23010a50de4 | https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Bridge/Elasticsearch/DataProvider/Filter/AbstractSearchFilter.php#L150-L153 | train |
api-platform/core | src/Bridge/Doctrine/Common/DataPersister.php | DataPersister.getManager | private function getManager($data): ?DoctrineObjectManager
{
return \is_object($data) ? $this->managerRegistry->getManagerForClass($this->getObjectClass($data)) : null;
} | php | private function getManager($data): ?DoctrineObjectManager
{
return \is_object($data) ? $this->managerRegistry->getManagerForClass($this->getObjectClass($data)) : null;
} | [
"private",
"function",
"getManager",
"(",
"$",
"data",
")",
":",
"?",
"DoctrineObjectManager",
"{",
"return",
"\\",
"is_object",
"(",
"$",
"data",
")",
"?",
"$",
"this",
"->",
"managerRegistry",
"->",
"getManagerForClass",
"(",
"$",
"this",
"->",
"getObjectC... | Gets the Doctrine object manager associated with given data. | [
"Gets",
"the",
"Doctrine",
"object",
"manager",
"associated",
"with",
"given",
"data",
"."
] | 0888bf33429a37d031345bf7c720f23010a50de4 | https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Bridge/Doctrine/Common/DataPersister.php#L81-L84 | train |
api-platform/core | src/Bridge/Doctrine/Common/DataPersister.php | DataPersister.isDeferredExplicit | private function isDeferredExplicit(DoctrineObjectManager $manager, $data): bool
{
$classMetadata = $manager->getClassMetadata($this->getObjectClass($data));
if ($classMetadata instanceof ClassMetadataInfo && method_exists($classMetadata, 'isChangeTrackingDeferredExplicit')) {
return $cl... | php | private function isDeferredExplicit(DoctrineObjectManager $manager, $data): bool
{
$classMetadata = $manager->getClassMetadata($this->getObjectClass($data));
if ($classMetadata instanceof ClassMetadataInfo && method_exists($classMetadata, 'isChangeTrackingDeferredExplicit')) {
return $cl... | [
"private",
"function",
"isDeferredExplicit",
"(",
"DoctrineObjectManager",
"$",
"manager",
",",
"$",
"data",
")",
":",
"bool",
"{",
"$",
"classMetadata",
"=",
"$",
"manager",
"->",
"getClassMetadata",
"(",
"$",
"this",
"->",
"getObjectClass",
"(",
"$",
"data",... | Checks if doctrine does not manage data automatically. | [
"Checks",
"if",
"doctrine",
"does",
"not",
"manage",
"data",
"automatically",
"."
] | 0888bf33429a37d031345bf7c720f23010a50de4 | https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Bridge/Doctrine/Common/DataPersister.php#L89-L97 | train |
api-platform/core | src/Bridge/Doctrine/EventListener/PurgeHttpCacheListener.php | PurgeHttpCacheListener.preUpdate | public function preUpdate(PreUpdateEventArgs $eventArgs): void
{
$object = $eventArgs->getObject();
$this->gatherResourceAndItemTags($object, true);
$changeSet = $eventArgs->getEntityChangeSet();
$associationMappings = $eventArgs->getEntityManager()->getClassMetadata(ClassUtils::get... | php | public function preUpdate(PreUpdateEventArgs $eventArgs): void
{
$object = $eventArgs->getObject();
$this->gatherResourceAndItemTags($object, true);
$changeSet = $eventArgs->getEntityChangeSet();
$associationMappings = $eventArgs->getEntityManager()->getClassMetadata(ClassUtils::get... | [
"public",
"function",
"preUpdate",
"(",
"PreUpdateEventArgs",
"$",
"eventArgs",
")",
":",
"void",
"{",
"$",
"object",
"=",
"$",
"eventArgs",
"->",
"getObject",
"(",
")",
";",
"$",
"this",
"->",
"gatherResourceAndItemTags",
"(",
"$",
"object",
",",
"true",
... | Collects tags from the previous and the current version of the updated entities to purge related documents. | [
"Collects",
"tags",
"from",
"the",
"previous",
"and",
"the",
"current",
"version",
"of",
"the",
"updated",
"entities",
"to",
"purge",
"related",
"documents",
"."
] | 0888bf33429a37d031345bf7c720f23010a50de4 | https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Bridge/Doctrine/EventListener/PurgeHttpCacheListener.php#L55-L71 | train |
api-platform/core | src/Bridge/Doctrine/EventListener/PurgeHttpCacheListener.php | PurgeHttpCacheListener.onFlush | public function onFlush(OnFlushEventArgs $eventArgs): void
{
$em = $eventArgs->getEntityManager();
$uow = $em->getUnitOfWork();
foreach ($uow->getScheduledEntityInsertions() as $entity) {
$this->gatherResourceAndItemTags($entity, false);
$this->gatherRelationTags($em... | php | public function onFlush(OnFlushEventArgs $eventArgs): void
{
$em = $eventArgs->getEntityManager();
$uow = $em->getUnitOfWork();
foreach ($uow->getScheduledEntityInsertions() as $entity) {
$this->gatherResourceAndItemTags($entity, false);
$this->gatherRelationTags($em... | [
"public",
"function",
"onFlush",
"(",
"OnFlushEventArgs",
"$",
"eventArgs",
")",
":",
"void",
"{",
"$",
"em",
"=",
"$",
"eventArgs",
"->",
"getEntityManager",
"(",
")",
";",
"$",
"uow",
"=",
"$",
"em",
"->",
"getUnitOfWork",
"(",
")",
";",
"foreach",
"... | Collects tags from inserted and deleted entities, including relations. | [
"Collects",
"tags",
"from",
"inserted",
"and",
"deleted",
"entities",
"including",
"relations",
"."
] | 0888bf33429a37d031345bf7c720f23010a50de4 | https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Bridge/Doctrine/EventListener/PurgeHttpCacheListener.php#L76-L95 | train |
api-platform/core | src/Bridge/Doctrine/EventListener/PurgeHttpCacheListener.php | PurgeHttpCacheListener.postFlush | public function postFlush(): void
{
if (empty($this->tags)) {
return;
}
$this->purger->purge($this->tags);
$this->tags = [];
} | php | public function postFlush(): void
{
if (empty($this->tags)) {
return;
}
$this->purger->purge($this->tags);
$this->tags = [];
} | [
"public",
"function",
"postFlush",
"(",
")",
":",
"void",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"tags",
")",
")",
"{",
"return",
";",
"}",
"$",
"this",
"->",
"purger",
"->",
"purge",
"(",
"$",
"this",
"->",
"tags",
")",
";",
"$",
"th... | Purges tags collected during this request, and clears the tag list. | [
"Purges",
"tags",
"collected",
"during",
"this",
"request",
"and",
"clears",
"the",
"tag",
"list",
"."
] | 0888bf33429a37d031345bf7c720f23010a50de4 | https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Bridge/Doctrine/EventListener/PurgeHttpCacheListener.php#L100-L108 | train |
api-platform/core | src/HttpCache/EventListener/AddTagsListener.php | AddTagsListener.onKernelResponse | public function onKernelResponse(FilterResponseEvent $event): void
{
$request = $event->getRequest();
$response = $event->getResponse();
if (
!$request->isMethodCacheable()
|| !$response->isCacheable()
|| (!$attributes = RequestAttributesExtractor::extrac... | php | public function onKernelResponse(FilterResponseEvent $event): void
{
$request = $event->getRequest();
$response = $event->getResponse();
if (
!$request->isMethodCacheable()
|| !$response->isCacheable()
|| (!$attributes = RequestAttributesExtractor::extrac... | [
"public",
"function",
"onKernelResponse",
"(",
"FilterResponseEvent",
"$",
"event",
")",
":",
"void",
"{",
"$",
"request",
"=",
"$",
"event",
"->",
"getRequest",
"(",
")",
";",
"$",
"response",
"=",
"$",
"event",
"->",
"getResponse",
"(",
")",
";",
"if",... | Adds the "Cache-Tags" header. | [
"Adds",
"the",
"Cache",
"-",
"Tags",
"header",
"."
] | 0888bf33429a37d031345bf7c720f23010a50de4 | https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/HttpCache/EventListener/AddTagsListener.php#L43-L68 | train |
api-platform/core | src/Bridge/Doctrine/MongoDbOdm/Filter/RangeFilter.php | RangeFilter.addMatch | protected function addMatch(Builder $aggregationBuilder, string $field, string $matchField, string $operator, string $value)
{
switch ($operator) {
case self::PARAMETER_BETWEEN:
$rangeValue = explode('..', $value);
$rangeValue = $this->normalizeBetweenValues($ran... | php | protected function addMatch(Builder $aggregationBuilder, string $field, string $matchField, string $operator, string $value)
{
switch ($operator) {
case self::PARAMETER_BETWEEN:
$rangeValue = explode('..', $value);
$rangeValue = $this->normalizeBetweenValues($ran... | [
"protected",
"function",
"addMatch",
"(",
"Builder",
"$",
"aggregationBuilder",
",",
"string",
"$",
"field",
",",
"string",
"$",
"matchField",
",",
"string",
"$",
"operator",
",",
"string",
"$",
"value",
")",
"{",
"switch",
"(",
"$",
"operator",
")",
"{",
... | Adds the match stage according to the operator. | [
"Adds",
"the",
"match",
"stage",
"according",
"to",
"the",
"operator",
"."
] | 0888bf33429a37d031345bf7c720f23010a50de4 | https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Bridge/Doctrine/MongoDbOdm/Filter/RangeFilter.php#L70-L121 | train |
api-platform/core | src/Bridge/Doctrine/Orm/Filter/DateFilter.php | DateFilter.addWhere | protected function addWhere(QueryBuilder $queryBuilder, QueryNameGeneratorInterface $queryNameGenerator, string $alias, string $field, string $operator, string $value, string $nullManagement = null, $type = null)
{
$type = (string) $type;
try {
$value = false === strpos($type, '_immutabl... | php | protected function addWhere(QueryBuilder $queryBuilder, QueryNameGeneratorInterface $queryNameGenerator, string $alias, string $field, string $operator, string $value, string $nullManagement = null, $type = null)
{
$type = (string) $type;
try {
$value = false === strpos($type, '_immutabl... | [
"protected",
"function",
"addWhere",
"(",
"QueryBuilder",
"$",
"queryBuilder",
",",
"QueryNameGeneratorInterface",
"$",
"queryNameGenerator",
",",
"string",
"$",
"alias",
",",
"string",
"$",
"field",
",",
"string",
"$",
"operator",
",",
"string",
"$",
"value",
"... | Adds the where clause according to the chosen null management.
@param string|DBALType $type | [
"Adds",
"the",
"where",
"clause",
"according",
"to",
"the",
"chosen",
"null",
"management",
"."
] | 0888bf33429a37d031345bf7c720f23010a50de4 | https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Bridge/Doctrine/Orm/Filter/DateFilter.php#L131-L173 | train |
api-platform/core | src/Bridge/Doctrine/Orm/Util/QueryBuilderHelper.php | QueryBuilderHelper.addJoinOnce | public static function addJoinOnce(QueryBuilder $queryBuilder, QueryNameGeneratorInterface $queryNameGenerator, string $alias, string $association, string $joinType = null, string $conditionType = null, string $condition = null, string $originAlias = null): string
{
$join = self::getExistingJoin($queryBuild... | php | public static function addJoinOnce(QueryBuilder $queryBuilder, QueryNameGeneratorInterface $queryNameGenerator, string $alias, string $association, string $joinType = null, string $conditionType = null, string $condition = null, string $originAlias = null): string
{
$join = self::getExistingJoin($queryBuild... | [
"public",
"static",
"function",
"addJoinOnce",
"(",
"QueryBuilder",
"$",
"queryBuilder",
",",
"QueryNameGeneratorInterface",
"$",
"queryNameGenerator",
",",
"string",
"$",
"alias",
",",
"string",
"$",
"association",
",",
"string",
"$",
"joinType",
"=",
"null",
","... | Adds a join to the QueryBuilder if none exists. | [
"Adds",
"a",
"join",
"to",
"the",
"QueryBuilder",
"if",
"none",
"exists",
"."
] | 0888bf33429a37d031345bf7c720f23010a50de4 | https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Bridge/Doctrine/Orm/Util/QueryBuilderHelper.php#L34-L52 | train |
api-platform/core | src/Bridge/Doctrine/Orm/Util/QueryBuilderHelper.php | QueryBuilderHelper.getEntityClassByAlias | public static function getEntityClassByAlias(string $alias, QueryBuilder $queryBuilder, ManagerRegistry $managerRegistry): string
{
if (!\in_array($alias, $queryBuilder->getAllAliases(), true)) {
throw new \LogicException(sprintf('The alias "%s" does not exist in the QueryBuilder.', $alias));
... | php | public static function getEntityClassByAlias(string $alias, QueryBuilder $queryBuilder, ManagerRegistry $managerRegistry): string
{
if (!\in_array($alias, $queryBuilder->getAllAliases(), true)) {
throw new \LogicException(sprintf('The alias "%s" does not exist in the QueryBuilder.', $alias));
... | [
"public",
"static",
"function",
"getEntityClassByAlias",
"(",
"string",
"$",
"alias",
",",
"QueryBuilder",
"$",
"queryBuilder",
",",
"ManagerRegistry",
"$",
"managerRegistry",
")",
":",
"string",
"{",
"if",
"(",
"!",
"\\",
"in_array",
"(",
"$",
"alias",
",",
... | Gets the entity class name by an alias used in the QueryBuilder. | [
"Gets",
"the",
"entity",
"class",
"name",
"by",
"an",
"alias",
"used",
"in",
"the",
"QueryBuilder",
"."
] | 0888bf33429a37d031345bf7c720f23010a50de4 | https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Bridge/Doctrine/Orm/Util/QueryBuilderHelper.php#L57-L80 | train |
api-platform/core | src/Bridge/Doctrine/Orm/Util/QueryBuilderHelper.php | QueryBuilderHelper.findRootAlias | public static function findRootAlias(string $alias, QueryBuilder $queryBuilder): string
{
if (\in_array($alias, $queryBuilder->getRootAliases(), true)) {
return $alias;
}
foreach ($queryBuilder->getDQLPart('join') as $rootAlias => $joins) {
foreach ($joins as $join) ... | php | public static function findRootAlias(string $alias, QueryBuilder $queryBuilder): string
{
if (\in_array($alias, $queryBuilder->getRootAliases(), true)) {
return $alias;
}
foreach ($queryBuilder->getDQLPart('join') as $rootAlias => $joins) {
foreach ($joins as $join) ... | [
"public",
"static",
"function",
"findRootAlias",
"(",
"string",
"$",
"alias",
",",
"QueryBuilder",
"$",
"queryBuilder",
")",
":",
"string",
"{",
"if",
"(",
"\\",
"in_array",
"(",
"$",
"alias",
",",
"$",
"queryBuilder",
"->",
"getRootAliases",
"(",
")",
","... | Finds the root alias for an alias used in the QueryBuilder. | [
"Finds",
"the",
"root",
"alias",
"for",
"an",
"alias",
"used",
"in",
"the",
"QueryBuilder",
"."
] | 0888bf33429a37d031345bf7c720f23010a50de4 | https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Bridge/Doctrine/Orm/Util/QueryBuilderHelper.php#L85-L100 | train |
api-platform/core | src/Bridge/Doctrine/Orm/Util/QueryBuilderHelper.php | QueryBuilderHelper.traverseJoins | public static function traverseJoins(string $alias, QueryBuilder $queryBuilder, ManagerRegistry $managerRegistry): \Generator
{
$rootAliasMap = self::mapRootAliases($queryBuilder->getRootAliases(), $queryBuilder->getRootEntities());
$joinParts = $queryBuilder->getDQLPart('join');
$rootAlias... | php | public static function traverseJoins(string $alias, QueryBuilder $queryBuilder, ManagerRegistry $managerRegistry): \Generator
{
$rootAliasMap = self::mapRootAliases($queryBuilder->getRootAliases(), $queryBuilder->getRootEntities());
$joinParts = $queryBuilder->getDQLPart('join');
$rootAlias... | [
"public",
"static",
"function",
"traverseJoins",
"(",
"string",
"$",
"alias",
",",
"QueryBuilder",
"$",
"queryBuilder",
",",
"ManagerRegistry",
"$",
"managerRegistry",
")",
":",
"\\",
"Generator",
"{",
"$",
"rootAliasMap",
"=",
"self",
"::",
"mapRootAliases",
"(... | Traverses through the joins for an alias used in the QueryBuilder.
@return \Generator<string, array> | [
"Traverses",
"through",
"the",
"joins",
"for",
"an",
"alias",
"used",
"in",
"the",
"QueryBuilder",
"."
] | 0888bf33429a37d031345bf7c720f23010a50de4 | https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Bridge/Doctrine/Orm/Util/QueryBuilderHelper.php#L107-L158 | train |
api-platform/core | src/Bridge/Doctrine/Orm/Util/QueryBuilderHelper.php | QueryBuilderHelper.getExistingJoin | private static function getExistingJoin(QueryBuilder $queryBuilder, string $alias, string $association, string $originAlias = null): ?Join
{
$parts = $queryBuilder->getDQLPart('join');
$rootAlias = $originAlias ?? $queryBuilder->getRootAliases()[0];
if (!isset($parts[$rootAlias])) {
... | php | private static function getExistingJoin(QueryBuilder $queryBuilder, string $alias, string $association, string $originAlias = null): ?Join
{
$parts = $queryBuilder->getDQLPart('join');
$rootAlias = $originAlias ?? $queryBuilder->getRootAliases()[0];
if (!isset($parts[$rootAlias])) {
... | [
"private",
"static",
"function",
"getExistingJoin",
"(",
"QueryBuilder",
"$",
"queryBuilder",
",",
"string",
"$",
"alias",
",",
"string",
"$",
"association",
",",
"string",
"$",
"originAlias",
"=",
"null",
")",
":",
"?",
"Join",
"{",
"$",
"parts",
"=",
"$"... | Gets the existing join from QueryBuilder DQL parts. | [
"Gets",
"the",
"existing",
"join",
"from",
"QueryBuilder",
"DQL",
"parts",
"."
] | 0888bf33429a37d031345bf7c720f23010a50de4 | https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Bridge/Doctrine/Orm/Util/QueryBuilderHelper.php#L163-L180 | train |
api-platform/core | src/Bridge/Doctrine/Orm/Util/QueryBuilderHelper.php | QueryBuilderHelper.mapRootAliases | private static function mapRootAliases(array $rootAliases, array $rootEntities): array
{
$aliasMap = array_combine($rootAliases, $rootEntities);
if (false === $aliasMap) {
throw new \LogicException('Number of root aliases and root entities do not match.');
}
return $alia... | php | private static function mapRootAliases(array $rootAliases, array $rootEntities): array
{
$aliasMap = array_combine($rootAliases, $rootEntities);
if (false === $aliasMap) {
throw new \LogicException('Number of root aliases and root entities do not match.');
}
return $alia... | [
"private",
"static",
"function",
"mapRootAliases",
"(",
"array",
"$",
"rootAliases",
",",
"array",
"$",
"rootEntities",
")",
":",
"array",
"{",
"$",
"aliasMap",
"=",
"array_combine",
"(",
"$",
"rootAliases",
",",
"$",
"rootEntities",
")",
";",
"if",
"(",
"... | Maps the root aliases to root entity classes.
@return array<string, string> | [
"Maps",
"the",
"root",
"aliases",
"to",
"root",
"entity",
"classes",
"."
] | 0888bf33429a37d031345bf7c720f23010a50de4 | https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Bridge/Doctrine/Orm/Util/QueryBuilderHelper.php#L187-L195 | train |
api-platform/core | src/Bridge/Doctrine/Orm/Util/QueryBuilderHelper.php | QueryBuilderHelper.mapJoinAliases | private static function mapJoinAliases(iterable $joins): array
{
$aliasMap = [];
foreach ($joins as $join) {
$alias = $join->getAlias();
$relationship = $join->getJoin();
if (false !== strpos($relationship, '.')) {
$aliasMap[$alias] = explode('.'... | php | private static function mapJoinAliases(iterable $joins): array
{
$aliasMap = [];
foreach ($joins as $join) {
$alias = $join->getAlias();
$relationship = $join->getJoin();
if (false !== strpos($relationship, '.')) {
$aliasMap[$alias] = explode('.'... | [
"private",
"static",
"function",
"mapJoinAliases",
"(",
"iterable",
"$",
"joins",
")",
":",
"array",
"{",
"$",
"aliasMap",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"joins",
"as",
"$",
"join",
")",
"{",
"$",
"alias",
"=",
"$",
"join",
"->",
"getAlias"... | Maps the join aliases to the parent alias and association, or the entity class.
@return array<string, string[]|string> | [
"Maps",
"the",
"join",
"aliases",
"to",
"the",
"parent",
"alias",
"and",
"association",
"or",
"the",
"entity",
"class",
"."
] | 0888bf33429a37d031345bf7c720f23010a50de4 | https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Bridge/Doctrine/Orm/Util/QueryBuilderHelper.php#L202-L218 | train |
api-platform/core | src/Api/FormatsProvider.php | FormatsProvider.getOperationFormats | private function getOperationFormats(array $annotationFormats): array
{
$resourceFormats = [];
foreach ($annotationFormats as $format => $value) {
if (!is_numeric($format)) {
$resourceFormats[$format] = (array) $value;
continue;
}
i... | php | private function getOperationFormats(array $annotationFormats): array
{
$resourceFormats = [];
foreach ($annotationFormats as $format => $value) {
if (!is_numeric($format)) {
$resourceFormats[$format] = (array) $value;
continue;
}
i... | [
"private",
"function",
"getOperationFormats",
"(",
"array",
"$",
"annotationFormats",
")",
":",
"array",
"{",
"$",
"resourceFormats",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"annotationFormats",
"as",
"$",
"format",
"=>",
"$",
"value",
")",
"{",
"if",
"("... | Filter and populate the acceptable formats.
@throws InvalidArgumentException | [
"Filter",
"and",
"populate",
"the",
"acceptable",
"formats",
"."
] | 0888bf33429a37d031345bf7c720f23010a50de4 | https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Api/FormatsProvider.php#L84-L104 | train |
api-platform/core | src/Bridge/Elasticsearch/Util/FieldDatatypeTrait.php | FieldDatatypeTrait.isNestedField | private function isNestedField(string $resourceClass, string $property): bool
{
return null !== $this->getNestedFieldPath($resourceClass, $property);
} | php | private function isNestedField(string $resourceClass, string $property): bool
{
return null !== $this->getNestedFieldPath($resourceClass, $property);
} | [
"private",
"function",
"isNestedField",
"(",
"string",
"$",
"resourceClass",
",",
"string",
"$",
"property",
")",
":",
"bool",
"{",
"return",
"null",
"!==",
"$",
"this",
"->",
"getNestedFieldPath",
"(",
"$",
"resourceClass",
",",
"$",
"property",
")",
";",
... | Is the decomposed given property of the given resource class potentially mapped as a nested field in Elasticsearch? | [
"Is",
"the",
"decomposed",
"given",
"property",
"of",
"the",
"given",
"resource",
"class",
"potentially",
"mapped",
"as",
"a",
"nested",
"field",
"in",
"Elasticsearch?"
] | 0888bf33429a37d031345bf7c720f23010a50de4 | https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Bridge/Elasticsearch/Util/FieldDatatypeTrait.php#L45-L48 | train |
api-platform/core | src/Bridge/Doctrine/Orm/Util/EagerLoadingTrait.php | EagerLoadingTrait.shouldOperationForceEager | private function shouldOperationForceEager(string $resourceClass, array $options): bool
{
return $this->getBooleanOperationAttribute($resourceClass, $options, 'force_eager', $this->forceEager);
} | php | private function shouldOperationForceEager(string $resourceClass, array $options): bool
{
return $this->getBooleanOperationAttribute($resourceClass, $options, 'force_eager', $this->forceEager);
} | [
"private",
"function",
"shouldOperationForceEager",
"(",
"string",
"$",
"resourceClass",
",",
"array",
"$",
"options",
")",
":",
"bool",
"{",
"return",
"$",
"this",
"->",
"getBooleanOperationAttribute",
"(",
"$",
"resourceClass",
",",
"$",
"options",
",",
"'forc... | Checks if an operation has a `force_eager` attribute. | [
"Checks",
"if",
"an",
"operation",
"has",
"a",
"force_eager",
"attribute",
"."
] | 0888bf33429a37d031345bf7c720f23010a50de4 | https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Bridge/Doctrine/Orm/Util/EagerLoadingTrait.php#L33-L36 | train |
api-platform/core | src/Bridge/Doctrine/Orm/Util/EagerLoadingTrait.php | EagerLoadingTrait.shouldOperationFetchPartial | private function shouldOperationFetchPartial(string $resourceClass, array $options): bool
{
return $this->getBooleanOperationAttribute($resourceClass, $options, 'fetch_partial', $this->fetchPartial);
} | php | private function shouldOperationFetchPartial(string $resourceClass, array $options): bool
{
return $this->getBooleanOperationAttribute($resourceClass, $options, 'fetch_partial', $this->fetchPartial);
} | [
"private",
"function",
"shouldOperationFetchPartial",
"(",
"string",
"$",
"resourceClass",
",",
"array",
"$",
"options",
")",
":",
"bool",
"{",
"return",
"$",
"this",
"->",
"getBooleanOperationAttribute",
"(",
"$",
"resourceClass",
",",
"$",
"options",
",",
"'fe... | Checks if an operation has a `fetch_partial` attribute. | [
"Checks",
"if",
"an",
"operation",
"has",
"a",
"fetch_partial",
"attribute",
"."
] | 0888bf33429a37d031345bf7c720f23010a50de4 | https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Bridge/Doctrine/Orm/Util/EagerLoadingTrait.php#L41-L44 | train |
api-platform/core | src/Bridge/Doctrine/Orm/Util/EagerLoadingTrait.php | EagerLoadingTrait.getBooleanOperationAttribute | private function getBooleanOperationAttribute(string $resourceClass, array $options, string $attributeName, bool $default): bool
{
$resourceMetadata = $this->resourceMetadataFactory->create($resourceClass);
if (isset($options['collection_operation_name'])) {
$attribute = $resourceMetada... | php | private function getBooleanOperationAttribute(string $resourceClass, array $options, string $attributeName, bool $default): bool
{
$resourceMetadata = $this->resourceMetadataFactory->create($resourceClass);
if (isset($options['collection_operation_name'])) {
$attribute = $resourceMetada... | [
"private",
"function",
"getBooleanOperationAttribute",
"(",
"string",
"$",
"resourceClass",
",",
"array",
"$",
"options",
",",
"string",
"$",
"attributeName",
",",
"bool",
"$",
"default",
")",
":",
"bool",
"{",
"$",
"resourceMetadata",
"=",
"$",
"this",
"->",
... | Get the boolean attribute of an operation or the resource metadata. | [
"Get",
"the",
"boolean",
"attribute",
"of",
"an",
"operation",
"or",
"the",
"resource",
"metadata",
"."
] | 0888bf33429a37d031345bf7c720f23010a50de4 | https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Bridge/Doctrine/Orm/Util/EagerLoadingTrait.php#L49-L62 | train |
api-platform/core | src/Bridge/Doctrine/Orm/Util/EagerLoadingTrait.php | EagerLoadingTrait.hasFetchEagerAssociation | private function hasFetchEagerAssociation(EntityManager $em, ClassMetadataInfo $classMetadata, array &$checked = []): bool
{
$checked[] = $classMetadata->name;
foreach ($classMetadata->getAssociationMappings() as $mapping) {
if (ClassMetadataInfo::FETCH_EAGER === $mapping['fetch']) {
... | php | private function hasFetchEagerAssociation(EntityManager $em, ClassMetadataInfo $classMetadata, array &$checked = []): bool
{
$checked[] = $classMetadata->name;
foreach ($classMetadata->getAssociationMappings() as $mapping) {
if (ClassMetadataInfo::FETCH_EAGER === $mapping['fetch']) {
... | [
"private",
"function",
"hasFetchEagerAssociation",
"(",
"EntityManager",
"$",
"em",
",",
"ClassMetadataInfo",
"$",
"classMetadata",
",",
"array",
"&",
"$",
"checked",
"=",
"[",
"]",
")",
":",
"bool",
"{",
"$",
"checked",
"[",
"]",
"=",
"$",
"classMetadata",
... | Checks if the class has an associationMapping with FETCH=EAGER.
@param array $checked array cache of tested metadata classes | [
"Checks",
"if",
"the",
"class",
"has",
"an",
"associationMapping",
"with",
"FETCH",
"=",
"EAGER",
"."
] | 0888bf33429a37d031345bf7c720f23010a50de4 | https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Bridge/Doctrine/Orm/Util/EagerLoadingTrait.php#L69-L90 | train |
api-platform/core | src/Bridge/Doctrine/Common/Util/IdentifierManagerTrait.php | IdentifierManagerTrait.normalizeIdentifiers | private function normalizeIdentifiers($id, ObjectManager $manager, string $resourceClass): array
{
$identifierValues = [$id];
$doctrineClassMetadata = $manager->getClassMetadata($resourceClass);
$doctrineIdentifierFields = $doctrineClassMetadata->getIdentifier();
$isOrm = $manager in... | php | private function normalizeIdentifiers($id, ObjectManager $manager, string $resourceClass): array
{
$identifierValues = [$id];
$doctrineClassMetadata = $manager->getClassMetadata($resourceClass);
$doctrineIdentifierFields = $doctrineClassMetadata->getIdentifier();
$isOrm = $manager in... | [
"private",
"function",
"normalizeIdentifiers",
"(",
"$",
"id",
",",
"ObjectManager",
"$",
"manager",
",",
"string",
"$",
"resourceClass",
")",
":",
"array",
"{",
"$",
"identifierValues",
"=",
"[",
"$",
"id",
"]",
";",
"$",
"doctrineClassMetadata",
"=",
"$",
... | Transform and check the identifier, composite or not.
@param int|string $id
@throws PropertyNotFoundException | [
"Transform",
"and",
"check",
"the",
"identifier",
"composite",
"or",
"not",
"."
] | 0888bf33429a37d031345bf7c720f23010a50de4 | https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Bridge/Doctrine/Common/Util/IdentifierManagerTrait.php#L38-L91 | train |
line/line-bot-sdk-php | src/LINEBot/Event/BaseEvent.php | BaseEvent.getGroupId | public function getGroupId()
{
if (!$this->isGroupEvent()) {
throw new InvalidEventSourceException('This event source is not a group type');
}
return isset($this->event['source']['groupId'])
? $this->event['source']['groupId']
: null;
} | php | public function getGroupId()
{
if (!$this->isGroupEvent()) {
throw new InvalidEventSourceException('This event source is not a group type');
}
return isset($this->event['source']['groupId'])
? $this->event['source']['groupId']
: null;
} | [
"public",
"function",
"getGroupId",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isGroupEvent",
"(",
")",
")",
"{",
"throw",
"new",
"InvalidEventSourceException",
"(",
"'This event source is not a group type'",
")",
";",
"}",
"return",
"isset",
"(",
"$",... | Returns group ID of the event.
@return string|null
@throws InvalidEventSourceException Raise when called with non group type event. | [
"Returns",
"group",
"ID",
"of",
"the",
"event",
"."
] | 01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e | https://github.com/line/line-bot-sdk-php/blob/01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e/src/LINEBot/Event/BaseEvent.php#L134-L142 | train |
line/line-bot-sdk-php | src/LINEBot/Event/BaseEvent.php | BaseEvent.getRoomId | public function getRoomId()
{
if (!$this->isRoomEvent()) {
throw new InvalidEventSourceException('This event source is not a room type');
}
return isset($this->event['source']['roomId'])
? $this->event['source']['roomId']
: null;
} | php | public function getRoomId()
{
if (!$this->isRoomEvent()) {
throw new InvalidEventSourceException('This event source is not a room type');
}
return isset($this->event['source']['roomId'])
? $this->event['source']['roomId']
: null;
} | [
"public",
"function",
"getRoomId",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isRoomEvent",
"(",
")",
")",
"{",
"throw",
"new",
"InvalidEventSourceException",
"(",
"'This event source is not a room type'",
")",
";",
"}",
"return",
"isset",
"(",
"$",
... | Returns room ID of the event.
@return string|null
@throws InvalidEventSourceException Raise when called with non room type event. | [
"Returns",
"room",
"ID",
"of",
"the",
"event",
"."
] | 01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e | https://github.com/line/line-bot-sdk-php/blob/01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e/src/LINEBot/Event/BaseEvent.php#L150-L158 | train |
line/line-bot-sdk-php | src/LINEBot/MessageBuilder/LocationMessageBuilder.php | LocationMessageBuilder.buildMessage | public function buildMessage()
{
if (!empty($this->message)) {
return $this->message;
}
$locationMessage = [
'type' => MessageType::LOCATION,
'title' => $this->title,
'address' => $this->address,
'latitude' => $this->latitude,
... | php | public function buildMessage()
{
if (!empty($this->message)) {
return $this->message;
}
$locationMessage = [
'type' => MessageType::LOCATION,
'title' => $this->title,
'address' => $this->address,
'latitude' => $this->latitude,
... | [
"public",
"function",
"buildMessage",
"(",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"message",
")",
")",
"{",
"return",
"$",
"this",
"->",
"message",
";",
"}",
"$",
"locationMessage",
"=",
"[",
"'type'",
"=>",
"MessageType",
"::",
"... | Builds location message structure.
@return array | [
"Builds",
"location",
"message",
"structure",
"."
] | 01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e | https://github.com/line/line-bot-sdk-php/blob/01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e/src/LINEBot/MessageBuilder/LocationMessageBuilder.php#L73-L94 | train |
line/line-bot-sdk-php | src/LINEBot.php | LINEBot.replyMessage | public function replyMessage($replyToken, MessageBuilder $messageBuilder)
{
return $this->httpClient->post($this->endpointBase . '/v2/bot/message/reply', [
'replyToken' => $replyToken,
'messages' => $messageBuilder->buildMessage(),
]);
} | php | public function replyMessage($replyToken, MessageBuilder $messageBuilder)
{
return $this->httpClient->post($this->endpointBase . '/v2/bot/message/reply', [
'replyToken' => $replyToken,
'messages' => $messageBuilder->buildMessage(),
]);
} | [
"public",
"function",
"replyMessage",
"(",
"$",
"replyToken",
",",
"MessageBuilder",
"$",
"messageBuilder",
")",
"{",
"return",
"$",
"this",
"->",
"httpClient",
"->",
"post",
"(",
"$",
"this",
"->",
"endpointBase",
".",
"'/v2/bot/message/reply'",
",",
"[",
"'r... | Replies arbitrary message to destination which is associated with reply token.
@param string $replyToken Identifier of destination.
@param MessageBuilder $messageBuilder Message builder to send.
@return Response | [
"Replies",
"arbitrary",
"message",
"to",
"destination",
"which",
"is",
"associated",
"with",
"reply",
"token",
"."
] | 01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e | https://github.com/line/line-bot-sdk-php/blob/01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e/src/LINEBot.php#L95-L101 | train |
line/line-bot-sdk-php | src/LINEBot.php | LINEBot.pushMessage | public function pushMessage($to, MessageBuilder $messageBuilder)
{
return $this->httpClient->post($this->endpointBase . '/v2/bot/message/push', [
'to' => $to,
'messages' => $messageBuilder->buildMessage(),
]);
} | php | public function pushMessage($to, MessageBuilder $messageBuilder)
{
return $this->httpClient->post($this->endpointBase . '/v2/bot/message/push', [
'to' => $to,
'messages' => $messageBuilder->buildMessage(),
]);
} | [
"public",
"function",
"pushMessage",
"(",
"$",
"to",
",",
"MessageBuilder",
"$",
"messageBuilder",
")",
"{",
"return",
"$",
"this",
"->",
"httpClient",
"->",
"post",
"(",
"$",
"this",
"->",
"endpointBase",
".",
"'/v2/bot/message/push'",
",",
"[",
"'to'",
"=>... | Sends arbitrary message to destination.
@param string $to Identifier of destination.
@param MessageBuilder $messageBuilder Message builder to send.
@return Response | [
"Sends",
"arbitrary",
"message",
"to",
"destination",
"."
] | 01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e | https://github.com/line/line-bot-sdk-php/blob/01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e/src/LINEBot.php#L144-L150 | train |
line/line-bot-sdk-php | src/LINEBot.php | LINEBot.multicast | public function multicast(array $tos, MessageBuilder $messageBuilder)
{
return $this->httpClient->post($this->endpointBase . '/v2/bot/message/multicast', [
'to' => $tos,
'messages' => $messageBuilder->buildMessage(),
]);
} | php | public function multicast(array $tos, MessageBuilder $messageBuilder)
{
return $this->httpClient->post($this->endpointBase . '/v2/bot/message/multicast', [
'to' => $tos,
'messages' => $messageBuilder->buildMessage(),
]);
} | [
"public",
"function",
"multicast",
"(",
"array",
"$",
"tos",
",",
"MessageBuilder",
"$",
"messageBuilder",
")",
"{",
"return",
"$",
"this",
"->",
"httpClient",
"->",
"post",
"(",
"$",
"this",
"->",
"endpointBase",
".",
"'/v2/bot/message/multicast'",
",",
"[",
... | Sends arbitrary message to multi destinations.
@param array $tos Identifiers of destination.
@param MessageBuilder $messageBuilder Message builder to send.
@return Response | [
"Sends",
"arbitrary",
"message",
"to",
"multi",
"destinations",
"."
] | 01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e | https://github.com/line/line-bot-sdk-php/blob/01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e/src/LINEBot.php#L159-L165 | train |
line/line-bot-sdk-php | src/LINEBot.php | LINEBot.parseEventRequest | public function parseEventRequest($body, $signature, $eventOnly = true)
{
return EventRequestParser::parseEventRequest($body, $this->channelSecret, $signature, $eventOnly);
} | php | public function parseEventRequest($body, $signature, $eventOnly = true)
{
return EventRequestParser::parseEventRequest($body, $this->channelSecret, $signature, $eventOnly);
} | [
"public",
"function",
"parseEventRequest",
"(",
"$",
"body",
",",
"$",
"signature",
",",
"$",
"eventOnly",
"=",
"true",
")",
"{",
"return",
"EventRequestParser",
"::",
"parseEventRequest",
"(",
"$",
"body",
",",
"$",
"this",
"->",
"channelSecret",
",",
"$",
... | Parse event request to Event objects.
@param string $body Request body.
@param string $signature Signature of request.
@param bool $eventOnly if this flag on, get events only.
@return mixed
@throws LINEBot\Exception\InvalidEventRequestException
@throws LINEBot\Exception\InvalidSignatureException | [
"Parse",
"event",
"request",
"to",
"Event",
"objects",
"."
] | 01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e | https://github.com/line/line-bot-sdk-php/blob/01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e/src/LINEBot.php#L199-L202 | train |
line/line-bot-sdk-php | src/LINEBot.php | LINEBot.getGroupMemberProfile | public function getGroupMemberProfile($groupId, $userId)
{
$url = sprintf('%s/v2/bot/group/%s/member/%s', $this->endpointBase, urlencode($groupId), urlencode($userId));
return $this->httpClient->get($url, []);
} | php | public function getGroupMemberProfile($groupId, $userId)
{
$url = sprintf('%s/v2/bot/group/%s/member/%s', $this->endpointBase, urlencode($groupId), urlencode($userId));
return $this->httpClient->get($url, []);
} | [
"public",
"function",
"getGroupMemberProfile",
"(",
"$",
"groupId",
",",
"$",
"userId",
")",
"{",
"$",
"url",
"=",
"sprintf",
"(",
"'%s/v2/bot/group/%s/member/%s'",
",",
"$",
"this",
"->",
"endpointBase",
",",
"urlencode",
"(",
"$",
"groupId",
")",
",",
"url... | Gets the user profile of a member of a group that the bot is in.
This can be the user ID of a user who has not added the bot as a friend or has blocked the bot.
@param string $groupId Identifier of the group
@param string $userId Identifier of the user
@return Response | [
"Gets",
"the",
"user",
"profile",
"of",
"a",
"member",
"of",
"a",
"group",
"that",
"the",
"bot",
"is",
"in",
".",
"This",
"can",
"be",
"the",
"user",
"ID",
"of",
"a",
"user",
"who",
"has",
"not",
"added",
"the",
"bot",
"as",
"a",
"friend",
"or",
... | 01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e | https://github.com/line/line-bot-sdk-php/blob/01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e/src/LINEBot.php#L225-L229 | train |
line/line-bot-sdk-php | src/LINEBot.php | LINEBot.getRoomMemberProfile | public function getRoomMemberProfile($roomId, $userId)
{
$url = sprintf('%s/v2/bot/room/%s/member/%s', $this->endpointBase, urlencode($roomId), urlencode($userId));
return $this->httpClient->get($url, []);
} | php | public function getRoomMemberProfile($roomId, $userId)
{
$url = sprintf('%s/v2/bot/room/%s/member/%s', $this->endpointBase, urlencode($roomId), urlencode($userId));
return $this->httpClient->get($url, []);
} | [
"public",
"function",
"getRoomMemberProfile",
"(",
"$",
"roomId",
",",
"$",
"userId",
")",
"{",
"$",
"url",
"=",
"sprintf",
"(",
"'%s/v2/bot/room/%s/member/%s'",
",",
"$",
"this",
"->",
"endpointBase",
",",
"urlencode",
"(",
"$",
"roomId",
")",
",",
"urlenco... | Gets the user profile of a member of a room that the bot is in.
This can be the user ID of a user who has not added the bot as a friend or has blocked the bot.
@param string $roomId Identifier of the room
@param string $userId Identifier of the user
@return Response | [
"Gets",
"the",
"user",
"profile",
"of",
"a",
"member",
"of",
"a",
"room",
"that",
"the",
"bot",
"is",
"in",
".",
"This",
"can",
"be",
"the",
"user",
"ID",
"of",
"a",
"user",
"who",
"has",
"not",
"added",
"the",
"bot",
"as",
"a",
"friend",
"or",
"... | 01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e | https://github.com/line/line-bot-sdk-php/blob/01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e/src/LINEBot.php#L239-L243 | train |
line/line-bot-sdk-php | src/LINEBot.php | LINEBot.getGroupMemberIds | public function getGroupMemberIds($groupId, $start = null)
{
$url = sprintf('%s/v2/bot/group/%s/members/ids', $this->endpointBase, urlencode($groupId));
$params = is_null($start) ? [] : ['start' => $start];
return $this->httpClient->get($url, $params);
} | php | public function getGroupMemberIds($groupId, $start = null)
{
$url = sprintf('%s/v2/bot/group/%s/members/ids', $this->endpointBase, urlencode($groupId));
$params = is_null($start) ? [] : ['start' => $start];
return $this->httpClient->get($url, $params);
} | [
"public",
"function",
"getGroupMemberIds",
"(",
"$",
"groupId",
",",
"$",
"start",
"=",
"null",
")",
"{",
"$",
"url",
"=",
"sprintf",
"(",
"'%s/v2/bot/group/%s/members/ids'",
",",
"$",
"this",
"->",
"endpointBase",
",",
"urlencode",
"(",
"$",
"groupId",
")",... | Gets the user IDs of the members of a group that the bot is in.
This includes the user IDs of users who have not added the bot as a friend or has blocked the bot.
This feature is only available for LINE@ Approved accounts or official accounts.
@param string $groupId Identifier of the group
@param string $start contin... | [
"Gets",
"the",
"user",
"IDs",
"of",
"the",
"members",
"of",
"a",
"group",
"that",
"the",
"bot",
"is",
"in",
".",
"This",
"includes",
"the",
"user",
"IDs",
"of",
"users",
"who",
"have",
"not",
"added",
"the",
"bot",
"as",
"a",
"friend",
"or",
"has",
... | 01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e | https://github.com/line/line-bot-sdk-php/blob/01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e/src/LINEBot.php#L255-L260 | train |
line/line-bot-sdk-php | src/LINEBot.php | LINEBot.getRoomMemberIds | public function getRoomMemberIds($roomId, $start = null)
{
$url = sprintf('%s/v2/bot/room/%s/members/ids', $this->endpointBase, urlencode($roomId));
$params = is_null($start) ? [] : ['start' => $start];
return $this->httpClient->get($url, $params);
} | php | public function getRoomMemberIds($roomId, $start = null)
{
$url = sprintf('%s/v2/bot/room/%s/members/ids', $this->endpointBase, urlencode($roomId));
$params = is_null($start) ? [] : ['start' => $start];
return $this->httpClient->get($url, $params);
} | [
"public",
"function",
"getRoomMemberIds",
"(",
"$",
"roomId",
",",
"$",
"start",
"=",
"null",
")",
"{",
"$",
"url",
"=",
"sprintf",
"(",
"'%s/v2/bot/room/%s/members/ids'",
",",
"$",
"this",
"->",
"endpointBase",
",",
"urlencode",
"(",
"$",
"roomId",
")",
"... | Gets the user IDs of the members of a room that the bot is in.
This includes the user IDs of users who have not added the bot as a friend or has blocked the bot.
This feature is only available for LINE@ Approved accounts or official accounts.
@param string $roomId Identifier of the room
@param string $start continuat... | [
"Gets",
"the",
"user",
"IDs",
"of",
"the",
"members",
"of",
"a",
"room",
"that",
"the",
"bot",
"is",
"in",
".",
"This",
"includes",
"the",
"user",
"IDs",
"of",
"users",
"who",
"have",
"not",
"added",
"the",
"bot",
"as",
"a",
"friend",
"or",
"has",
... | 01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e | https://github.com/line/line-bot-sdk-php/blob/01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e/src/LINEBot.php#L272-L277 | train |
line/line-bot-sdk-php | src/LINEBot.php | LINEBot.createLinkToken | public function createLinkToken($userId)
{
$url = sprintf('%s/v2/bot/user/%s/linkToken', $this->endpointBase, urlencode($userId));
return $this->httpClient->post($url, []);
} | php | public function createLinkToken($userId)
{
$url = sprintf('%s/v2/bot/user/%s/linkToken', $this->endpointBase, urlencode($userId));
return $this->httpClient->post($url, []);
} | [
"public",
"function",
"createLinkToken",
"(",
"$",
"userId",
")",
"{",
"$",
"url",
"=",
"sprintf",
"(",
"'%s/v2/bot/user/%s/linkToken'",
",",
"$",
"this",
"->",
"endpointBase",
",",
"urlencode",
"(",
"$",
"userId",
")",
")",
";",
"return",
"$",
"this",
"->... | Issues a link token used for the account link feature.
@param string $userId User ID for the LINE account to be linked.
@return Response | [
"Issues",
"a",
"link",
"token",
"used",
"for",
"the",
"account",
"link",
"feature",
"."
] | 01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e | https://github.com/line/line-bot-sdk-php/blob/01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e/src/LINEBot.php#L335-L339 | train |
line/line-bot-sdk-php | src/LINEBot.php | LINEBot.deleteRichMenu | public function deleteRichMenu($richMenuId)
{
$url = sprintf('%s/v2/bot/richmenu/%s', $this->endpointBase, urlencode($richMenuId));
return $this->httpClient->delete($url);
} | php | public function deleteRichMenu($richMenuId)
{
$url = sprintf('%s/v2/bot/richmenu/%s', $this->endpointBase, urlencode($richMenuId));
return $this->httpClient->delete($url);
} | [
"public",
"function",
"deleteRichMenu",
"(",
"$",
"richMenuId",
")",
"{",
"$",
"url",
"=",
"sprintf",
"(",
"'%s/v2/bot/richmenu/%s'",
",",
"$",
"this",
"->",
"endpointBase",
",",
"urlencode",
"(",
"$",
"richMenuId",
")",
")",
";",
"return",
"$",
"this",
"-... | Deletes a rich menu.
@param string $richMenuId ID of an uploaded rich menu
@return Response | [
"Deletes",
"a",
"rich",
"menu",
"."
] | 01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e | https://github.com/line/line-bot-sdk-php/blob/01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e/src/LINEBot.php#L372-L376 | train |
line/line-bot-sdk-php | src/LINEBot.php | LINEBot.getRichMenuId | public function getRichMenuId($userId)
{
$url = sprintf('%s/v2/bot/user/%s/richmenu', $this->endpointBase, urlencode($userId));
return $this->httpClient->get($url, []);
} | php | public function getRichMenuId($userId)
{
$url = sprintf('%s/v2/bot/user/%s/richmenu', $this->endpointBase, urlencode($userId));
return $this->httpClient->get($url, []);
} | [
"public",
"function",
"getRichMenuId",
"(",
"$",
"userId",
")",
"{",
"$",
"url",
"=",
"sprintf",
"(",
"'%s/v2/bot/user/%s/richmenu'",
",",
"$",
"this",
"->",
"endpointBase",
",",
"urlencode",
"(",
"$",
"userId",
")",
")",
";",
"return",
"$",
"this",
"->",
... | Gets the ID of the rich menu linked to a user.
@param string $userId User ID. Found in the source object of webhook event objects.
@return Response | [
"Gets",
"the",
"ID",
"of",
"the",
"rich",
"menu",
"linked",
"to",
"a",
"user",
"."
] | 01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e | https://github.com/line/line-bot-sdk-php/blob/01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e/src/LINEBot.php#L384-L388 | train |
line/line-bot-sdk-php | src/LINEBot.php | LINEBot.linkRichMenu | public function linkRichMenu($userId, $richMenuId)
{
$url = sprintf(
'%s/v2/bot/user/%s/richmenu/%s',
$this->endpointBase,
urlencode($userId),
urlencode($richMenuId)
);
return $this->httpClient->post($url, []);
} | php | public function linkRichMenu($userId, $richMenuId)
{
$url = sprintf(
'%s/v2/bot/user/%s/richmenu/%s',
$this->endpointBase,
urlencode($userId),
urlencode($richMenuId)
);
return $this->httpClient->post($url, []);
} | [
"public",
"function",
"linkRichMenu",
"(",
"$",
"userId",
",",
"$",
"richMenuId",
")",
"{",
"$",
"url",
"=",
"sprintf",
"(",
"'%s/v2/bot/user/%s/richmenu/%s'",
",",
"$",
"this",
"->",
"endpointBase",
",",
"urlencode",
"(",
"$",
"userId",
")",
",",
"urlencode... | Links a rich menu to a user. Only one rich menu can be linked to a user at one time.
@param string $userId User ID. Found in the source object of webhook event objects.
@param string $richMenuId ID of an uploaded rich menu
@return Response | [
"Links",
"a",
"rich",
"menu",
"to",
"a",
"user",
".",
"Only",
"one",
"rich",
"menu",
"can",
"be",
"linked",
"to",
"a",
"user",
"at",
"one",
"time",
"."
] | 01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e | https://github.com/line/line-bot-sdk-php/blob/01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e/src/LINEBot.php#L397-L406 | train |
line/line-bot-sdk-php | src/LINEBot.php | LINEBot.bulkLinkRichMenu | public function bulkLinkRichMenu($userIds, $richMenuId)
{
$url = $this->endpointBase . '/v2/bot/richmenu/bulk/link';
return $this->httpClient->post($url, [
'richMenuId' => $richMenuId,
'userIds' => $userIds
]);
} | php | public function bulkLinkRichMenu($userIds, $richMenuId)
{
$url = $this->endpointBase . '/v2/bot/richmenu/bulk/link';
return $this->httpClient->post($url, [
'richMenuId' => $richMenuId,
'userIds' => $userIds
]);
} | [
"public",
"function",
"bulkLinkRichMenu",
"(",
"$",
"userIds",
",",
"$",
"richMenuId",
")",
"{",
"$",
"url",
"=",
"$",
"this",
"->",
"endpointBase",
".",
"'/v2/bot/richmenu/bulk/link'",
";",
"return",
"$",
"this",
"->",
"httpClient",
"->",
"post",
"(",
"$",
... | Links a rich menu to multiple users.
@param string[] $userIds Found in the source object of webhook event objects. Max: 150 user IDs.
@param string $richMenuId ID of an uploaded rich menu
@return Response | [
"Links",
"a",
"rich",
"menu",
"to",
"multiple",
"users",
"."
] | 01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e | https://github.com/line/line-bot-sdk-php/blob/01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e/src/LINEBot.php#L415-L422 | train |
line/line-bot-sdk-php | src/LINEBot.php | LINEBot.unlinkRichMenu | public function unlinkRichMenu($userId)
{
$url = sprintf('%s/v2/bot/user/%s/richmenu', $this->endpointBase, urlencode($userId));
return $this->httpClient->delete($url);
} | php | public function unlinkRichMenu($userId)
{
$url = sprintf('%s/v2/bot/user/%s/richmenu', $this->endpointBase, urlencode($userId));
return $this->httpClient->delete($url);
} | [
"public",
"function",
"unlinkRichMenu",
"(",
"$",
"userId",
")",
"{",
"$",
"url",
"=",
"sprintf",
"(",
"'%s/v2/bot/user/%s/richmenu'",
",",
"$",
"this",
"->",
"endpointBase",
",",
"urlencode",
"(",
"$",
"userId",
")",
")",
";",
"return",
"$",
"this",
"->",... | Unlinks a rich menu from multiple user.
@param string $userId User ID. Found in the source object of webhook event objects.
@return Response | [
"Unlinks",
"a",
"rich",
"menu",
"from",
"multiple",
"user",
"."
] | 01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e | https://github.com/line/line-bot-sdk-php/blob/01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e/src/LINEBot.php#L430-L434 | train |
line/line-bot-sdk-php | src/LINEBot.php | LINEBot.bulkUnlinkRichMenu | public function bulkUnlinkRichMenu($userIds)
{
$url = $this->endpointBase . '/v2/bot/richmenu/bulk/unlink';
return $this->httpClient->post($url, [
'userIds' => $userIds
]);
} | php | public function bulkUnlinkRichMenu($userIds)
{
$url = $this->endpointBase . '/v2/bot/richmenu/bulk/unlink';
return $this->httpClient->post($url, [
'userIds' => $userIds
]);
} | [
"public",
"function",
"bulkUnlinkRichMenu",
"(",
"$",
"userIds",
")",
"{",
"$",
"url",
"=",
"$",
"this",
"->",
"endpointBase",
".",
"'/v2/bot/richmenu/bulk/unlink'",
";",
"return",
"$",
"this",
"->",
"httpClient",
"->",
"post",
"(",
"$",
"url",
",",
"[",
"... | Unlinks rich menus from multiple users.
@param string[] $userIds Found in the source object of webhook event objects. Max: 150 user IDs.
@return Response | [
"Unlinks",
"rich",
"menus",
"from",
"multiple",
"users",
"."
] | 01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e | https://github.com/line/line-bot-sdk-php/blob/01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e/src/LINEBot.php#L442-L448 | train |
line/line-bot-sdk-php | src/LINEBot.php | LINEBot.downloadRichMenuImage | public function downloadRichMenuImage($richMenuId)
{
$url = sprintf('%s/v2/bot/richmenu/%s/content', $this->endpointBase, urlencode($richMenuId));
return $this->httpClient->get($url);
} | php | public function downloadRichMenuImage($richMenuId)
{
$url = sprintf('%s/v2/bot/richmenu/%s/content', $this->endpointBase, urlencode($richMenuId));
return $this->httpClient->get($url);
} | [
"public",
"function",
"downloadRichMenuImage",
"(",
"$",
"richMenuId",
")",
"{",
"$",
"url",
"=",
"sprintf",
"(",
"'%s/v2/bot/richmenu/%s/content'",
",",
"$",
"this",
"->",
"endpointBase",
",",
"urlencode",
"(",
"$",
"richMenuId",
")",
")",
";",
"return",
"$",... | Downloads an image associated with a rich menu.
@param string $richMenuId ID of an uploaded rich menu
@return Response | [
"Downloads",
"an",
"image",
"associated",
"with",
"a",
"rich",
"menu",
"."
] | 01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e | https://github.com/line/line-bot-sdk-php/blob/01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e/src/LINEBot.php#L456-L460 | train |
line/line-bot-sdk-php | src/LINEBot.php | LINEBot.uploadRichMenuImage | public function uploadRichMenuImage($richMenuId, $imagePath, $contentType)
{
$url = sprintf('%s/v2/bot/richmenu/%s/content', $this->endpointBase, urlencode($richMenuId));
return $this->httpClient->post(
$url,
[
'__file' => $imagePath,
'__type' ... | php | public function uploadRichMenuImage($richMenuId, $imagePath, $contentType)
{
$url = sprintf('%s/v2/bot/richmenu/%s/content', $this->endpointBase, urlencode($richMenuId));
return $this->httpClient->post(
$url,
[
'__file' => $imagePath,
'__type' ... | [
"public",
"function",
"uploadRichMenuImage",
"(",
"$",
"richMenuId",
",",
"$",
"imagePath",
",",
"$",
"contentType",
")",
"{",
"$",
"url",
"=",
"sprintf",
"(",
"'%s/v2/bot/richmenu/%s/content'",
",",
"$",
"this",
"->",
"endpointBase",
",",
"urlencode",
"(",
"$... | Uploads and attaches an image to a rich menu.
Notes:
<ul><li>Images must have one of the following resolutions: 2500x1686 or 2500x843 pixels.</li>
<li>You cannot replace an image attached to a rich menu. To update your rich menu image,
create a new rich menu object and upload another image.</li></ul>
@param string $r... | [
"Uploads",
"and",
"attaches",
"an",
"image",
"to",
"a",
"rich",
"menu",
"."
] | 01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e | https://github.com/line/line-bot-sdk-php/blob/01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e/src/LINEBot.php#L475-L486 | train |
line/line-bot-sdk-php | src/LINEBot.php | LINEBot.getNumberOfSentReplyMessages | public function getNumberOfSentReplyMessages(DateTime $datetime)
{
$url = $this->endpointBase . '/v2/bot/message/delivery/reply';
$datetime->setTimezone(new DateTimeZone('Asia/Tokyo'));
return $this->httpClient->get($url, ['date' => $datetime->format('Ymd')]);
} | php | public function getNumberOfSentReplyMessages(DateTime $datetime)
{
$url = $this->endpointBase . '/v2/bot/message/delivery/reply';
$datetime->setTimezone(new DateTimeZone('Asia/Tokyo'));
return $this->httpClient->get($url, ['date' => $datetime->format('Ymd')]);
} | [
"public",
"function",
"getNumberOfSentReplyMessages",
"(",
"DateTime",
"$",
"datetime",
")",
"{",
"$",
"url",
"=",
"$",
"this",
"->",
"endpointBase",
".",
"'/v2/bot/message/delivery/reply'",
";",
"$",
"datetime",
"->",
"setTimezone",
"(",
"new",
"DateTimeZone",
"(... | Get number of sent reply messages
@param DateTime $datetime Date the messages were sent.
@return Response | [
"Get",
"number",
"of",
"sent",
"reply",
"messages"
] | 01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e | https://github.com/line/line-bot-sdk-php/blob/01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e/src/LINEBot.php#L504-L509 | train |
line/line-bot-sdk-php | src/LINEBot/MessageBuilder/Flex/BlockStyleBuilder.php | BlockStyleBuilder.build | public function build()
{
if (isset($this->style)) {
return $this->style;
}
$this->style = BuildUtil::removeNullElements([
'backgroundColor' => $this->backgroundColor,
'separator' => $this->separator,
'separatorColor' => $this->separatorColor,... | php | public function build()
{
if (isset($this->style)) {
return $this->style;
}
$this->style = BuildUtil::removeNullElements([
'backgroundColor' => $this->backgroundColor,
'separator' => $this->separator,
'separatorColor' => $this->separatorColor,... | [
"public",
"function",
"build",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"style",
")",
")",
"{",
"return",
"$",
"this",
"->",
"style",
";",
"}",
"$",
"this",
"->",
"style",
"=",
"BuildUtil",
"::",
"removeNullElements",
"(",
"[",
"'... | Builds block style structure.
@return array | [
"Builds",
"block",
"style",
"structure",
"."
] | 01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e | https://github.com/line/line-bot-sdk-php/blob/01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e/src/LINEBot/MessageBuilder/Flex/BlockStyleBuilder.php#L105-L118 | train |
line/line-bot-sdk-php | src/LINEBot/MessageBuilder/Flex/ComponentBuilder/ImageComponentBuilder.php | ImageComponentBuilder.build | public function build()
{
if (isset($this->component)) {
return $this->component;
}
$this->component = BuildUtil::removeNullElements([
'type' => ComponentType::IMAGE,
'url' => $this->url,
'flex' => $this->flex,
'margin' => $this->m... | php | public function build()
{
if (isset($this->component)) {
return $this->component;
}
$this->component = BuildUtil::removeNullElements([
'type' => ComponentType::IMAGE,
'url' => $this->url,
'flex' => $this->flex,
'margin' => $this->m... | [
"public",
"function",
"build",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"component",
")",
")",
"{",
"return",
"$",
"this",
"->",
"component",
";",
"}",
"$",
"this",
"->",
"component",
"=",
"BuildUtil",
"::",
"removeNullElements",
"(",... | Builds image component structure.
@return array | [
"Builds",
"image",
"component",
"structure",
"."
] | 01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e | https://github.com/line/line-bot-sdk-php/blob/01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e/src/LINEBot/MessageBuilder/Flex/ComponentBuilder/ImageComponentBuilder.php#L237-L258 | train |
line/line-bot-sdk-php | src/LINEBot/MessageBuilder/Flex/ComponentBuilder/TextComponentBuilder.php | TextComponentBuilder.build | public function build()
{
if (isset($this->component)) {
return $this->component;
}
$this->component = BuildUtil::removeNullElements([
'type' => ComponentType::TEXT,
'text' => $this->text,
'flex' => $this->flex,
'margin' => $this->... | php | public function build()
{
if (isset($this->component)) {
return $this->component;
}
$this->component = BuildUtil::removeNullElements([
'type' => ComponentType::TEXT,
'text' => $this->text,
'flex' => $this->flex,
'margin' => $this->... | [
"public",
"function",
"build",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"component",
")",
")",
"{",
"return",
"$",
"this",
"->",
"component",
";",
"}",
"$",
"this",
"->",
"component",
"=",
"BuildUtil",
"::",
"removeNullElements",
"(",... | Builds text component structure.
@return array | [
"Builds",
"text",
"component",
"structure",
"."
] | 01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e | https://github.com/line/line-bot-sdk-php/blob/01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e/src/LINEBot/MessageBuilder/Flex/ComponentBuilder/TextComponentBuilder.php#L253-L275 | train |
line/line-bot-sdk-php | src/LINEBot/MessageBuilder/TemplateBuilder/CarouselColumnTemplateBuilder.php | CarouselColumnTemplateBuilder.buildTemplate | public function buildTemplate()
{
if (!empty($this->template)) {
return $this->template;
}
$actions = [];
foreach ($this->actionBuilders as $actionBuilder) {
$actions[] = $actionBuilder->buildTemplateAction();
}
$this->template = [
... | php | public function buildTemplate()
{
if (!empty($this->template)) {
return $this->template;
}
$actions = [];
foreach ($this->actionBuilders as $actionBuilder) {
$actions[] = $actionBuilder->buildTemplateAction();
}
$this->template = [
... | [
"public",
"function",
"buildTemplate",
"(",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"template",
")",
")",
"{",
"return",
"$",
"this",
"->",
"template",
";",
"}",
"$",
"actions",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
... | Builds column of carousel template structure.
@return array | [
"Builds",
"column",
"of",
"carousel",
"template",
"structure",
"."
] | 01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e | https://github.com/line/line-bot-sdk-php/blob/01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e/src/LINEBot/MessageBuilder/TemplateBuilder/CarouselColumnTemplateBuilder.php#L68-L91 | train |
line/line-bot-sdk-php | src/LINEBot/MessageBuilder/Flex/ContainerBuilder/BubbleContainerBuilder.php | BubbleContainerBuilder.build | public function build()
{
if (!empty($this->container)) {
return $this->container;
}
$this->container = BuildUtil::removeNullElements([
'type' => ContainerType::BUBBLE,
'direction' => $this->direction,
'header' => BuildUtil::build($this->heade... | php | public function build()
{
if (!empty($this->container)) {
return $this->container;
}
$this->container = BuildUtil::removeNullElements([
'type' => ContainerType::BUBBLE,
'direction' => $this->direction,
'header' => BuildUtil::build($this->heade... | [
"public",
"function",
"build",
"(",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"container",
")",
")",
"{",
"return",
"$",
"this",
"->",
"container",
";",
"}",
"$",
"this",
"->",
"container",
"=",
"BuildUtil",
"::",
"removeNullElements",... | Builds bubble container structure.
@return array | [
"Builds",
"bubble",
"container",
"structure",
"."
] | 01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e | https://github.com/line/line-bot-sdk-php/blob/01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e/src/LINEBot/MessageBuilder/Flex/ContainerBuilder/BubbleContainerBuilder.php#L165-L182 | train |
line/line-bot-sdk-php | src/LINEBot/MessageBuilder/TemplateBuilder/ButtonTemplateBuilder.php | ButtonTemplateBuilder.buildTemplate | public function buildTemplate()
{
if (!empty($this->template)) {
return $this->template;
}
$actions = [];
foreach ($this->actionBuilders as $actionBuilder) {
$actions[] = $actionBuilder->buildTemplateAction();
}
$this->template = [
... | php | public function buildTemplate()
{
if (!empty($this->template)) {
return $this->template;
}
$actions = [];
foreach ($this->actionBuilders as $actionBuilder) {
$actions[] = $actionBuilder->buildTemplateAction();
}
$this->template = [
... | [
"public",
"function",
"buildTemplate",
"(",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"template",
")",
")",
"{",
"return",
"$",
"this",
"->",
"template",
";",
"}",
"$",
"actions",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
... | Builds button template message structure.
@return array | [
"Builds",
"button",
"template",
"message",
"structure",
"."
] | 01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e | https://github.com/line/line-bot-sdk-php/blob/01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e/src/LINEBot/MessageBuilder/TemplateBuilder/ButtonTemplateBuilder.php#L99-L141 | train |
line/line-bot-sdk-php | src/LINEBot/MessageBuilder/Flex/ComponentBuilder/SeparatorComponentBuilder.php | SeparatorComponentBuilder.build | public function build()
{
if (isset($this->component)) {
return $this->component;
}
$this->component = BuildUtil::removeNullElements([
'type' => ComponentType::SEPARATOR,
'margin' => $this->margin,
'color' => $this->color,
]);
... | php | public function build()
{
if (isset($this->component)) {
return $this->component;
}
$this->component = BuildUtil::removeNullElements([
'type' => ComponentType::SEPARATOR,
'margin' => $this->margin,
'color' => $this->color,
]);
... | [
"public",
"function",
"build",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"component",
")",
")",
"{",
"return",
"$",
"this",
"->",
"component",
";",
"}",
"$",
"this",
"->",
"component",
"=",
"BuildUtil",
"::",
"removeNullElements",
"(",... | Builds separator component structure.
@return array | [
"Builds",
"separator",
"component",
"structure",
"."
] | 01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e | https://github.com/line/line-bot-sdk-php/blob/01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e/src/LINEBot/MessageBuilder/Flex/ComponentBuilder/SeparatorComponentBuilder.php#L92-L105 | train |
line/line-bot-sdk-php | src/LINEBot/MessageBuilder/TextMessageBuilder.php | TextMessageBuilder.buildMessage | public function buildMessage()
{
if (!empty($this->message)) {
return $this->message;
}
foreach ($this->texts as $text) {
$this->message[] = [
'type' => MessageType::TEXT,
'text' => $text,
];
}
if ($this->q... | php | public function buildMessage()
{
if (!empty($this->message)) {
return $this->message;
}
foreach ($this->texts as $text) {
$this->message[] = [
'type' => MessageType::TEXT,
'text' => $text,
];
}
if ($this->q... | [
"public",
"function",
"buildMessage",
"(",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"message",
")",
")",
"{",
"return",
"$",
"this",
"->",
"message",
";",
"}",
"foreach",
"(",
"$",
"this",
"->",
"texts",
"as",
"$",
"text",
")",
... | Builds text message structure.
@return array | [
"Builds",
"text",
"message",
"structure",
"."
] | 01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e | https://github.com/line/line-bot-sdk-php/blob/01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e/src/LINEBot/MessageBuilder/TextMessageBuilder.php#L79-L101 | train |
line/line-bot-sdk-php | src/LINEBot/MessageBuilder/Flex/BubbleStylesBuilder.php | BubbleStylesBuilder.build | public function build()
{
if (isset($this->styles)) {
return $this->styles;
}
$this->styles = BuildUtil::removeNullElements([
'header' => BuildUtil::build($this->headerStyleBuilder),
'hero' => BuildUtil::build($this->heroStyleBuilder),
'body' ... | php | public function build()
{
if (isset($this->styles)) {
return $this->styles;
}
$this->styles = BuildUtil::removeNullElements([
'header' => BuildUtil::build($this->headerStyleBuilder),
'hero' => BuildUtil::build($this->heroStyleBuilder),
'body' ... | [
"public",
"function",
"build",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"styles",
")",
")",
"{",
"return",
"$",
"this",
"->",
"styles",
";",
"}",
"$",
"this",
"->",
"styles",
"=",
"BuildUtil",
"::",
"removeNullElements",
"(",
"[",
... | Builds bubble styles structure.
@return array | [
"Builds",
"bubble",
"styles",
"structure",
"."
] | 01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e | https://github.com/line/line-bot-sdk-php/blob/01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e/src/LINEBot/MessageBuilder/Flex/BubbleStylesBuilder.php#L125-L139 | train |
line/line-bot-sdk-php | src/LINEBot/MessageBuilder/StickerMessageBuilder.php | StickerMessageBuilder.buildMessage | public function buildMessage()
{
if (!empty($this->message)) {
return $this->message;
}
$sticker = [
'type' => MessageType::STICKER,
'packageId' => $this->packageId,
'stickerId' => $this->stickerId,
];
if ($this->quickReply) {... | php | public function buildMessage()
{
if (!empty($this->message)) {
return $this->message;
}
$sticker = [
'type' => MessageType::STICKER,
'packageId' => $this->packageId,
'stickerId' => $this->stickerId,
];
if ($this->quickReply) {... | [
"public",
"function",
"buildMessage",
"(",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"message",
")",
")",
"{",
"return",
"$",
"this",
"->",
"message",
";",
"}",
"$",
"sticker",
"=",
"[",
"'type'",
"=>",
"MessageType",
"::",
"STICKER"... | Builds sticker message structure.
@return array | [
"Builds",
"sticker",
"message",
"structure",
"."
] | 01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e | https://github.com/line/line-bot-sdk-php/blob/01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e/src/LINEBot/MessageBuilder/StickerMessageBuilder.php#L63-L82 | train |
line/line-bot-sdk-php | src/LINEBot/MessageBuilder/Imagemap/VideoBuilder.php | VideoBuilder.build | public function build()
{
$video = [
'originalContentUrl' => $this->originalContentUrl,
'previewImageUrl' => $this->previewImageUrl,
'area' => $this->areaBuilder->build()
];
if ($this->externalLinkBuilder) {
$video['externalLink'] = $this->exte... | php | public function build()
{
$video = [
'originalContentUrl' => $this->originalContentUrl,
'previewImageUrl' => $this->previewImageUrl,
'area' => $this->areaBuilder->build()
];
if ($this->externalLinkBuilder) {
$video['externalLink'] = $this->exte... | [
"public",
"function",
"build",
"(",
")",
"{",
"$",
"video",
"=",
"[",
"'originalContentUrl'",
"=>",
"$",
"this",
"->",
"originalContentUrl",
",",
"'previewImageUrl'",
"=>",
"$",
"this",
"->",
"previewImageUrl",
",",
"'area'",
"=>",
"$",
"this",
"->",
"areaBu... | Builds video of imagemap.
@return array | [
"Builds",
"video",
"of",
"imagemap",
"."
] | 01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e | https://github.com/line/line-bot-sdk-php/blob/01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e/src/LINEBot/MessageBuilder/Imagemap/VideoBuilder.php#L64-L75 | train |
line/line-bot-sdk-php | src/LINEBot/MessageBuilder/AudioMessageBuilder.php | AudioMessageBuilder.buildMessage | public function buildMessage()
{
if (!empty($this->message)) {
return $this->message;
}
$audioMessage = [
'type' => MessageType::AUDIO,
'originalContentUrl' => $this->originalContentUrl,
'duration' => $this->duration,
];
if ($... | php | public function buildMessage()
{
if (!empty($this->message)) {
return $this->message;
}
$audioMessage = [
'type' => MessageType::AUDIO,
'originalContentUrl' => $this->originalContentUrl,
'duration' => $this->duration,
];
if ($... | [
"public",
"function",
"buildMessage",
"(",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"message",
")",
")",
"{",
"return",
"$",
"this",
"->",
"message",
";",
"}",
"$",
"audioMessage",
"=",
"[",
"'type'",
"=>",
"MessageType",
"::",
"AUD... | Build audio message structure.
@return array | [
"Build",
"audio",
"message",
"structure",
"."
] | 01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e | https://github.com/line/line-bot-sdk-php/blob/01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e/src/LINEBot/MessageBuilder/AudioMessageBuilder.php#L63-L82 | train |
line/line-bot-sdk-php | src/LINEBot/MessageBuilder/ImageMessageBuilder.php | ImageMessageBuilder.buildMessage | public function buildMessage()
{
if (!empty($this->message)) {
return $this->message;
}
$imageMessage = [
'type' => MessageType::IMAGE,
'originalContentUrl' => $this->originalContentUrl,
'previewImageUrl' => $this->previewImageUrl,
];
... | php | public function buildMessage()
{
if (!empty($this->message)) {
return $this->message;
}
$imageMessage = [
'type' => MessageType::IMAGE,
'originalContentUrl' => $this->originalContentUrl,
'previewImageUrl' => $this->previewImageUrl,
];
... | [
"public",
"function",
"buildMessage",
"(",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"message",
")",
")",
"{",
"return",
"$",
"this",
"->",
"message",
";",
"}",
"$",
"imageMessage",
"=",
"[",
"'type'",
"=>",
"MessageType",
"::",
"IMA... | Builds image message structure.
@return array | [
"Builds",
"image",
"message",
"structure",
"."
] | 01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e | https://github.com/line/line-bot-sdk-php/blob/01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e/src/LINEBot/MessageBuilder/ImageMessageBuilder.php#L63-L82 | train |
line/line-bot-sdk-php | src/LINEBot/MessageBuilder/TemplateBuilder/ConfirmTemplateBuilder.php | ConfirmTemplateBuilder.buildTemplate | public function buildTemplate()
{
if (!empty($this->template)) {
return $this->template;
}
$actions = [];
foreach ($this->actionBuilders as $actionBuilder) {
$actions[] = $actionBuilder->buildTemplateAction();
}
$this->template = [
... | php | public function buildTemplate()
{
if (!empty($this->template)) {
return $this->template;
}
$actions = [];
foreach ($this->actionBuilders as $actionBuilder) {
$actions[] = $actionBuilder->buildTemplateAction();
}
$this->template = [
... | [
"public",
"function",
"buildTemplate",
"(",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"template",
")",
")",
"{",
"return",
"$",
"this",
"->",
"template",
";",
"}",
"$",
"actions",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
... | Builds confirm template structure.
@return array | [
"Builds",
"confirm",
"template",
"structure",
"."
] | 01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e | https://github.com/line/line-bot-sdk-php/blob/01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e/src/LINEBot/MessageBuilder/TemplateBuilder/ConfirmTemplateBuilder.php#L57-L75 | train |
line/line-bot-sdk-php | src/LINEBot/HTTPClient/CurlHTTPClient.php | CurlHTTPClient.get | public function get($url, array $data = [], array $headers = [])
{
if ($data) {
$url .= '?' . http_build_query($data);
}
return $this->sendRequest('GET', $url, $headers);
} | php | public function get($url, array $data = [], array $headers = [])
{
if ($data) {
$url .= '?' . http_build_query($data);
}
return $this->sendRequest('GET', $url, $headers);
} | [
"public",
"function",
"get",
"(",
"$",
"url",
",",
"array",
"$",
"data",
"=",
"[",
"]",
",",
"array",
"$",
"headers",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"$",
"data",
")",
"{",
"$",
"url",
".=",
"'?'",
".",
"http_build_query",
"(",
"$",
"data",... | Sends GET request to LINE Messaging API.
@param string $url Request URL.
@param array $data Request body
@param array $headers Request headers.
@return Response Response of API request.
@throws CurlExecutionException | [
"Sends",
"GET",
"request",
"to",
"LINE",
"Messaging",
"API",
"."
] | 01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e | https://github.com/line/line-bot-sdk-php/blob/01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e/src/LINEBot/HTTPClient/CurlHTTPClient.php#L64-L70 | train |
line/line-bot-sdk-php | src/LINEBot/HTTPClient/CurlHTTPClient.php | CurlHTTPClient.post | public function post($url, array $data, array $headers = null)
{
$headers = is_null($headers) ? ['Content-Type: application/json; charset=utf-8'] : $headers;
return $this->sendRequest('POST', $url, $headers, $data);
} | php | public function post($url, array $data, array $headers = null)
{
$headers = is_null($headers) ? ['Content-Type: application/json; charset=utf-8'] : $headers;
return $this->sendRequest('POST', $url, $headers, $data);
} | [
"public",
"function",
"post",
"(",
"$",
"url",
",",
"array",
"$",
"data",
",",
"array",
"$",
"headers",
"=",
"null",
")",
"{",
"$",
"headers",
"=",
"is_null",
"(",
"$",
"headers",
")",
"?",
"[",
"'Content-Type: application/json; charset=utf-8'",
"]",
":",
... | Sends POST request to LINE Messaging API.
@param string $url Request URL.
@param array $data Request body or resource path.
@param array|null $headers Request headers.
@return Response Response of API request.
@throws CurlExecutionException | [
"Sends",
"POST",
"request",
"to",
"LINE",
"Messaging",
"API",
"."
] | 01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e | https://github.com/line/line-bot-sdk-php/blob/01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e/src/LINEBot/HTTPClient/CurlHTTPClient.php#L81-L85 | train |
line/line-bot-sdk-php | src/LINEBot/MessageBuilder/TemplateBuilder/ImageCarouselColumnTemplateBuilder.php | ImageCarouselColumnTemplateBuilder.buildTemplate | public function buildTemplate()
{
if (!empty($this->template)) {
return $this->template;
}
$this->template = [
'imageUrl' => $this->imageUrl,
'action' => $this->actionBuilder->buildTemplateAction(),
];
return $this->template;
} | php | public function buildTemplate()
{
if (!empty($this->template)) {
return $this->template;
}
$this->template = [
'imageUrl' => $this->imageUrl,
'action' => $this->actionBuilder->buildTemplateAction(),
];
return $this->template;
} | [
"public",
"function",
"buildTemplate",
"(",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"template",
")",
")",
"{",
"return",
"$",
"this",
"->",
"template",
";",
"}",
"$",
"this",
"->",
"template",
"=",
"[",
"'imageUrl'",
"=>",
"$",
"... | Builds column of image carousel template structure.
@return array | [
"Builds",
"column",
"of",
"image",
"carousel",
"template",
"structure",
"."
] | 01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e | https://github.com/line/line-bot-sdk-php/blob/01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e/src/LINEBot/MessageBuilder/TemplateBuilder/ImageCarouselColumnTemplateBuilder.php#L56-L68 | train |
line/line-bot-sdk-php | src/LINEBot/TemplateActionBuilder/DatetimePickerTemplateActionBuilder.php | DatetimePickerTemplateActionBuilder.buildTemplateAction | public function buildTemplateAction()
{
return [
'type' => ActionType::DATETIME_PICKER,
'label' => $this->label,
'data' => $this->data,
'mode' => $this->mode,
'initial' => $this->initial,
'max' => $this->max,
'min' => $this-... | php | public function buildTemplateAction()
{
return [
'type' => ActionType::DATETIME_PICKER,
'label' => $this->label,
'data' => $this->data,
'mode' => $this->mode,
'initial' => $this->initial,
'max' => $this->max,
'min' => $this-... | [
"public",
"function",
"buildTemplateAction",
"(",
")",
"{",
"return",
"[",
"'type'",
"=>",
"ActionType",
"::",
"DATETIME_PICKER",
",",
"'label'",
"=>",
"$",
"this",
"->",
"label",
",",
"'data'",
"=>",
"$",
"this",
"->",
"data",
",",
"'mode'",
"=>",
"$",
... | Builds datetime picker action structure.
@return array Built datetime picker action structure. | [
"Builds",
"datetime",
"picker",
"action",
"structure",
"."
] | 01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e | https://github.com/line/line-bot-sdk-php/blob/01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e/src/LINEBot/TemplateActionBuilder/DatetimePickerTemplateActionBuilder.php#L80-L91 | train |
line/line-bot-sdk-php | src/LINEBot/TemplateActionBuilder/UriTemplateActionBuilder.php | UriTemplateActionBuilder.buildTemplateAction | public function buildTemplateAction()
{
$templateAction = BuildUtil::removeNullElements([
'type' => ActionType::URI,
'label' => $this->label,
'uri' => $this->uri,
]);
if ($this->altUri) {
$templateAction['altUri'] = $this->altUri->build();
... | php | public function buildTemplateAction()
{
$templateAction = BuildUtil::removeNullElements([
'type' => ActionType::URI,
'label' => $this->label,
'uri' => $this->uri,
]);
if ($this->altUri) {
$templateAction['altUri'] = $this->altUri->build();
... | [
"public",
"function",
"buildTemplateAction",
"(",
")",
"{",
"$",
"templateAction",
"=",
"BuildUtil",
"::",
"removeNullElements",
"(",
"[",
"'type'",
"=>",
"ActionType",
"::",
"URI",
",",
"'label'",
"=>",
"$",
"this",
"->",
"label",
",",
"'uri'",
"=>",
"$",
... | Builds URI action structure.
@return array Built URI action structure. | [
"Builds",
"URI",
"action",
"structure",
"."
] | 01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e | https://github.com/line/line-bot-sdk-php/blob/01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e/src/LINEBot/TemplateActionBuilder/UriTemplateActionBuilder.php#L58-L71 | train |
line/line-bot-sdk-php | src/LINEBot/SignatureValidator.php | SignatureValidator.validateSignature | public static function validateSignature($body, $channelSecret, $signature)
{
if (!isset($signature)) {
throw new InvalidSignatureException('Signature must not be empty');
}
return hash_equals(base64_encode(hash_hmac('sha256', $body, $channelSecret, true)), $signature);
} | php | public static function validateSignature($body, $channelSecret, $signature)
{
if (!isset($signature)) {
throw new InvalidSignatureException('Signature must not be empty');
}
return hash_equals(base64_encode(hash_hmac('sha256', $body, $channelSecret, true)), $signature);
} | [
"public",
"static",
"function",
"validateSignature",
"(",
"$",
"body",
",",
"$",
"channelSecret",
",",
"$",
"signature",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"signature",
")",
")",
"{",
"throw",
"new",
"InvalidSignatureException",
"(",
"'Signature mu... | Validate request with signature.
@param string $body Request body.
@param string $channelSecret Your channel secret.
@param string $signature Signature (probably retrieve from HTTP header).
@return bool Request is valid or not.
@throws InvalidSignatureException When empty signature is given. | [
"Validate",
"request",
"with",
"signature",
"."
] | 01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e | https://github.com/line/line-bot-sdk-php/blob/01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e/src/LINEBot/SignatureValidator.php#L39-L46 | train |
line/line-bot-sdk-php | src/LINEBot/MessageBuilder/Flex/ComponentBuilder/IconComponentBuilder.php | IconComponentBuilder.build | public function build()
{
if (isset($this->component)) {
return $this->component;
}
$this->component = BuildUtil::removeNullElements([
'type' => ComponentType::ICON,
'url' => $this->url,
'margin' => $this->margin,
'size' => $this->... | php | public function build()
{
if (isset($this->component)) {
return $this->component;
}
$this->component = BuildUtil::removeNullElements([
'type' => ComponentType::ICON,
'url' => $this->url,
'margin' => $this->margin,
'size' => $this->... | [
"public",
"function",
"build",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"component",
")",
")",
"{",
"return",
"$",
"this",
"->",
"component",
";",
"}",
"$",
"this",
"->",
"component",
"=",
"BuildUtil",
"::",
"removeNullElements",
"(",... | Builds icon component structure.
@return array | [
"Builds",
"icon",
"component",
"structure",
"."
] | 01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e | https://github.com/line/line-bot-sdk-php/blob/01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e/src/LINEBot/MessageBuilder/Flex/ComponentBuilder/IconComponentBuilder.php#L126-L141 | train |
line/line-bot-sdk-php | src/LINEBot/MessageBuilder/Flex/ComponentBuilder/SpacerComponentBuilder.php | SpacerComponentBuilder.build | public function build()
{
if (isset($this->component)) {
return $this->component;
}
$this->component = BuildUtil::removeNullElements([
'type' => ComponentType::SPACER,
'size' => $this->size,
]);
return $this->component;
} | php | public function build()
{
if (isset($this->component)) {
return $this->component;
}
$this->component = BuildUtil::removeNullElements([
'type' => ComponentType::SPACER,
'size' => $this->size,
]);
return $this->component;
} | [
"public",
"function",
"build",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"component",
")",
")",
"{",
"return",
"$",
"this",
"->",
"component",
";",
"}",
"$",
"this",
"->",
"component",
"=",
"BuildUtil",
"::",
"removeNullElements",
"(",... | Builds spacer component structure.
@return array | [
"Builds",
"spacer",
"component",
"structure",
"."
] | 01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e | https://github.com/line/line-bot-sdk-php/blob/01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e/src/LINEBot/MessageBuilder/Flex/ComponentBuilder/SpacerComponentBuilder.php#L76-L88 | train |
line/line-bot-sdk-php | examples/KitchenSink/src/LINEBot/KitchenSink/EventHandler/MessageHandler/Flex/FlexSampleShopping.php | FlexSampleShopping.get | public static function get()
{
return FlexMessageBuilder::builder()
->setAltText('Shopping')
->setContents(new CarouselContainerBuilder([
self::createItemBubble(111),
self::createItemBubble(112),
self::createMoreBubble()
]))... | php | public static function get()
{
return FlexMessageBuilder::builder()
->setAltText('Shopping')
->setContents(new CarouselContainerBuilder([
self::createItemBubble(111),
self::createItemBubble(112),
self::createMoreBubble()
]))... | [
"public",
"static",
"function",
"get",
"(",
")",
"{",
"return",
"FlexMessageBuilder",
"::",
"builder",
"(",
")",
"->",
"setAltText",
"(",
"'Shopping'",
")",
"->",
"setContents",
"(",
"new",
"CarouselContainerBuilder",
"(",
"[",
"self",
"::",
"createItemBubble",
... | Create sample shopping flex message
@return \LINE\LINEBot\MessageBuilder\FlexMessageBuilder | [
"Create",
"sample",
"shopping",
"flex",
"message"
] | 01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e | https://github.com/line/line-bot-sdk-php/blob/01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e/examples/KitchenSink/src/LINEBot/KitchenSink/EventHandler/MessageHandler/Flex/FlexSampleShopping.php#L66-L75 | train |
line/line-bot-sdk-php | src/LINEBot/QuickReplyBuilder/QuickReplyMessageBuilder.php | QuickReplyMessageBuilder.buildQuickReply | public function buildQuickReply()
{
if (!empty($this->quickReply)) {
return $this->quickReply;
}
$items = [];
foreach ($this->buttonBuilders as $buttonBuilder) {
$items[] = $buttonBuilder->buildQuickReplyButton();
}
$this->quickReply = ['ite... | php | public function buildQuickReply()
{
if (!empty($this->quickReply)) {
return $this->quickReply;
}
$items = [];
foreach ($this->buttonBuilders as $buttonBuilder) {
$items[] = $buttonBuilder->buildQuickReplyButton();
}
$this->quickReply = ['ite... | [
"public",
"function",
"buildQuickReply",
"(",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"quickReply",
")",
")",
"{",
"return",
"$",
"this",
"->",
"quickReply",
";",
"}",
"$",
"items",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this"... | Builds button of quick reply structure.
@return array | [
"Builds",
"button",
"of",
"quick",
"reply",
"structure",
"."
] | 01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e | https://github.com/line/line-bot-sdk-php/blob/01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e/src/LINEBot/QuickReplyBuilder/QuickReplyMessageBuilder.php#L51-L66 | train |
line/line-bot-sdk-php | src/LINEBot/MessageBuilder/Flex/ComponentBuilder/BoxComponentBuilder.php | BoxComponentBuilder.build | public function build()
{
if (isset($this->component)) {
return $this->component;
}
$contents = array_map(function ($componentBuilder) {
/** @var ComponentBuilder $componentBuilder */
return $componentBuilder->build();
}, $this->componentBuilders)... | php | public function build()
{
if (isset($this->component)) {
return $this->component;
}
$contents = array_map(function ($componentBuilder) {
/** @var ComponentBuilder $componentBuilder */
return $componentBuilder->build();
}, $this->componentBuilders)... | [
"public",
"function",
"build",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"component",
")",
")",
"{",
"return",
"$",
"this",
"->",
"component",
";",
"}",
"$",
"contents",
"=",
"array_map",
"(",
"function",
"(",
"$",
"componentBuilder",
... | Builds box component structure.
@return array | [
"Builds",
"box",
"component",
"structure",
"."
] | 01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e | https://github.com/line/line-bot-sdk-php/blob/01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e/src/LINEBot/MessageBuilder/Flex/ComponentBuilder/BoxComponentBuilder.php#L165-L187 | train |
line/line-bot-sdk-php | examples/KitchenSink/src/LINEBot/KitchenSink/EventHandler/MessageHandler/Flex/FlexSampleRestaurant.php | FlexSampleRestaurant.get | public static function get()
{
return FlexMessageBuilder::builder()
->setAltText('Restaurant')
->setContents(
BubbleContainerBuilder::builder()
->setHero(self::createHeroBlock())
->setBody(self::createBodyBlock())
... | php | public static function get()
{
return FlexMessageBuilder::builder()
->setAltText('Restaurant')
->setContents(
BubbleContainerBuilder::builder()
->setHero(self::createHeroBlock())
->setBody(self::createBodyBlock())
... | [
"public",
"static",
"function",
"get",
"(",
")",
"{",
"return",
"FlexMessageBuilder",
"::",
"builder",
"(",
")",
"->",
"setAltText",
"(",
"'Restaurant'",
")",
"->",
"setContents",
"(",
"BubbleContainerBuilder",
"::",
"builder",
"(",
")",
"->",
"setHero",
"(",
... | Create sample restaurant flex message
@return \LINE\LINEBot\MessageBuilder\FlexMessageBuilder | [
"Create",
"sample",
"restaurant",
"flex",
"message"
] | 01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e | https://github.com/line/line-bot-sdk-php/blob/01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e/examples/KitchenSink/src/LINEBot/KitchenSink/EventHandler/MessageHandler/Flex/FlexSampleRestaurant.php#L54-L64 | train |
line/line-bot-sdk-php | src/LINEBot/MessageBuilder/ImagemapMessageBuilder.php | ImagemapMessageBuilder.buildMessage | public function buildMessage()
{
if (!empty($this->message)) {
return $this->message;
}
$actions = [];
foreach ($this->imagemapActionBuilders as $builder) {
$actions[] = $builder->buildImagemapAction();
}
$imagemapMessage = [
'typ... | php | public function buildMessage()
{
if (!empty($this->message)) {
return $this->message;
}
$actions = [];
foreach ($this->imagemapActionBuilders as $builder) {
$actions[] = $builder->buildImagemapAction();
}
$imagemapMessage = [
'typ... | [
"public",
"function",
"buildMessage",
"(",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"message",
")",
")",
"{",
"return",
"$",
"this",
"->",
"message",
";",
"}",
"$",
"actions",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->... | Builds imagemap message strucutre.
@return array | [
"Builds",
"imagemap",
"message",
"strucutre",
"."
] | 01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e | https://github.com/line/line-bot-sdk-php/blob/01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e/src/LINEBot/MessageBuilder/ImagemapMessageBuilder.php#L87-L117 | train |
line/line-bot-sdk-php | src/LINEBot/MessageBuilder/TemplateMessageBuilder.php | TemplateMessageBuilder.buildMessage | public function buildMessage()
{
if (!empty($this->message)) {
return $this->message;
}
$templateMessage = [
'type' => MessageType::TEMPLATE,
'altText' => $this->altText,
'template' => $this->templateBuilder->buildTemplate(),
];
... | php | public function buildMessage()
{
if (!empty($this->message)) {
return $this->message;
}
$templateMessage = [
'type' => MessageType::TEMPLATE,
'altText' => $this->altText,
'template' => $this->templateBuilder->buildTemplate(),
];
... | [
"public",
"function",
"buildMessage",
"(",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"message",
")",
")",
"{",
"return",
"$",
"this",
"->",
"message",
";",
"}",
"$",
"templateMessage",
"=",
"[",
"'type'",
"=>",
"MessageType",
"::",
"... | Builds template message structure.
@return array | [
"Builds",
"template",
"message",
"structure",
"."
] | 01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e | https://github.com/line/line-bot-sdk-php/blob/01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e/src/LINEBot/MessageBuilder/TemplateMessageBuilder.php#L65-L84 | train |
line/line-bot-sdk-php | src/LINEBot/MessageBuilder/FlexMessageBuilder.php | FlexMessageBuilder.buildMessage | public function buildMessage()
{
if (isset($this->message)) {
return $this->message;
}
$this->message = [
BuildUtil::removeNullElements([
'type' => MessageType::FLEX,
'altText' => $this->altText,
'contents' => $this->co... | php | public function buildMessage()
{
if (isset($this->message)) {
return $this->message;
}
$this->message = [
BuildUtil::removeNullElements([
'type' => MessageType::FLEX,
'altText' => $this->altText,
'contents' => $this->co... | [
"public",
"function",
"buildMessage",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"message",
")",
")",
"{",
"return",
"$",
"this",
"->",
"message",
";",
"}",
"$",
"this",
"->",
"message",
"=",
"[",
"BuildUtil",
"::",
"removeNullElements"... | Builds flex message structure.
@return array | [
"Builds",
"flex",
"message",
"structure",
"."
] | 01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e | https://github.com/line/line-bot-sdk-php/blob/01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e/src/LINEBot/MessageBuilder/FlexMessageBuilder.php#L110-L126 | train |
line/line-bot-sdk-php | src/LINEBot/MessageBuilder/Flex/ComponentBuilder/ButtonComponentBuilder.php | ButtonComponentBuilder.build | public function build()
{
if (isset($this->component)) {
return $this->component;
}
$this->component = BuildUtil::removeNullElements([
'type' => ComponentType::BUTTON,
'action' => $this->actionBuilder->buildTemplateAction(),
'flex' => $this->f... | php | public function build()
{
if (isset($this->component)) {
return $this->component;
}
$this->component = BuildUtil::removeNullElements([
'type' => ComponentType::BUTTON,
'action' => $this->actionBuilder->buildTemplateAction(),
'flex' => $this->f... | [
"public",
"function",
"build",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"component",
")",
")",
"{",
"return",
"$",
"this",
"->",
"component",
";",
"}",
"$",
"this",
"->",
"component",
"=",
"BuildUtil",
"::",
"removeNullElements",
"(",... | Builds button component structure.
@return array | [
"Builds",
"button",
"component",
"structure",
"."
] | 01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e | https://github.com/line/line-bot-sdk-php/blob/01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e/src/LINEBot/MessageBuilder/Flex/ComponentBuilder/ButtonComponentBuilder.php#L183-L201 | train |
line/line-bot-sdk-php | src/LINEBot/MessageBuilder/VideoMessageBuilder.php | VideoMessageBuilder.buildMessage | public function buildMessage()
{
if (!empty($this->message)) {
return $this->message;
}
$video = [
'type' => MessageType::VIDEO,
'originalContentUrl' => $this->originalContentUrl,
'previewImageUrl' => $this->previewImageUrl,
];
... | php | public function buildMessage()
{
if (!empty($this->message)) {
return $this->message;
}
$video = [
'type' => MessageType::VIDEO,
'originalContentUrl' => $this->originalContentUrl,
'previewImageUrl' => $this->previewImageUrl,
];
... | [
"public",
"function",
"buildMessage",
"(",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"message",
")",
")",
"{",
"return",
"$",
"this",
"->",
"message",
";",
"}",
"$",
"video",
"=",
"[",
"'type'",
"=>",
"MessageType",
"::",
"VIDEO",
... | Builds video message structure.
@return array | [
"Builds",
"video",
"message",
"structure",
"."
] | 01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e | https://github.com/line/line-bot-sdk-php/blob/01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e/src/LINEBot/MessageBuilder/VideoMessageBuilder.php#L63-L82 | train |
line/line-bot-sdk-php | src/LINEBot/TemplateActionBuilder/PostbackTemplateActionBuilder.php | PostbackTemplateActionBuilder.buildTemplateAction | public function buildTemplateAction()
{
$action = [
'type' => ActionType::POSTBACK,
'label' => $this->label,
'data' => $this->data,
];
if (isset($this->displayText)) {
// If text is set, append extend field.
$action['displayText'] ... | php | public function buildTemplateAction()
{
$action = [
'type' => ActionType::POSTBACK,
'label' => $this->label,
'data' => $this->data,
];
if (isset($this->displayText)) {
// If text is set, append extend field.
$action['displayText'] ... | [
"public",
"function",
"buildTemplateAction",
"(",
")",
"{",
"$",
"action",
"=",
"[",
"'type'",
"=>",
"ActionType",
"::",
"POSTBACK",
",",
"'label'",
"=>",
"$",
"this",
"->",
"label",
",",
"'data'",
"=>",
"$",
"this",
"->",
"data",
",",
"]",
";",
"if",
... | Builds postback action structure.
@return array Built postback action structure. | [
"Builds",
"postback",
"action",
"structure",
"."
] | 01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e | https://github.com/line/line-bot-sdk-php/blob/01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e/src/LINEBot/TemplateActionBuilder/PostbackTemplateActionBuilder.php#L57-L71 | train |
line/line-bot-sdk-php | src/LINEBot/MessageBuilder/Flex/ContainerBuilder/CarouselContainerBuilder.php | CarouselContainerBuilder.build | public function build()
{
if (!empty($this->container)) {
return $this->container;
}
$contents = array_map(function ($containerBuilder) {
return $containerBuilder->build();
}, $this->containerBuilders);
$this->container = [
'type' => Cont... | php | public function build()
{
if (!empty($this->container)) {
return $this->container;
}
$contents = array_map(function ($containerBuilder) {
return $containerBuilder->build();
}, $this->containerBuilders);
$this->container = [
'type' => Cont... | [
"public",
"function",
"build",
"(",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"container",
")",
")",
"{",
"return",
"$",
"this",
"->",
"container",
";",
"}",
"$",
"contents",
"=",
"array_map",
"(",
"function",
"(",
"$",
"containerBui... | Builds carousel container structure.
@return array | [
"Builds",
"carousel",
"container",
"structure",
"."
] | 01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e | https://github.com/line/line-bot-sdk-php/blob/01ba4d1c6c0c7ec57b5b34ed5bc6ee0d5f88928e/src/LINEBot/MessageBuilder/Flex/ContainerBuilder/CarouselContainerBuilder.php#L74-L90 | train |
web-push-libs/web-push-php | src/Subscription.php | Subscription.create | public static function create(array $associativeArray): Subscription
{
if (array_key_exists('keys', $associativeArray) && is_array($associativeArray['keys'])) {
return new self(
$associativeArray['endpoint'],
$associativeArray['keys']['p256dh'] ?? null,
... | php | public static function create(array $associativeArray): Subscription
{
if (array_key_exists('keys', $associativeArray) && is_array($associativeArray['keys'])) {
return new self(
$associativeArray['endpoint'],
$associativeArray['keys']['p256dh'] ?? null,
... | [
"public",
"static",
"function",
"create",
"(",
"array",
"$",
"associativeArray",
")",
":",
"Subscription",
"{",
"if",
"(",
"array_key_exists",
"(",
"'keys'",
",",
"$",
"associativeArray",
")",
"&&",
"is_array",
"(",
"$",
"associativeArray",
"[",
"'keys'",
"]",... | Subscription factory.
@param array $associativeArray (with keys endpoint, publicKey, authToken, contentEncoding)
@return Subscription
@throws \ErrorException | [
"Subscription",
"factory",
"."
] | b1e09e93fbbf3d4f95cee79a61191bd9df9f8f27 | https://github.com/web-push-libs/web-push-php/blob/b1e09e93fbbf3d4f95cee79a61191bd9df9f8f27/src/Subscription.php#L66-L89 | train |
web-push-libs/web-push-php | src/VAPID.php | VAPID.getVapidHeaders | public static function getVapidHeaders(string $audience, string $subject, string $publicKey, string $privateKey, string $contentEncoding, ?int $expiration = null)
{
$expirationLimit = time() + 43200; // equal margin of error between 0 and 24h
if (null === $expiration || $expiration > $expirationLimi... | php | public static function getVapidHeaders(string $audience, string $subject, string $publicKey, string $privateKey, string $contentEncoding, ?int $expiration = null)
{
$expirationLimit = time() + 43200; // equal margin of error between 0 and 24h
if (null === $expiration || $expiration > $expirationLimi... | [
"public",
"static",
"function",
"getVapidHeaders",
"(",
"string",
"$",
"audience",
",",
"string",
"$",
"subject",
",",
"string",
"$",
"publicKey",
",",
"string",
"$",
"privateKey",
",",
"string",
"$",
"contentEncoding",
",",
"?",
"int",
"$",
"expiration",
"=... | This method takes the required VAPID parameters and returns the required
header to be added to a Web Push Protocol Request.
@param string $audience This must be the origin of the push service
@param string $subject This should be a URL or a 'mailto:' email address
@param string $publicKey The decoded VAPID public key
... | [
"This",
"method",
"takes",
"the",
"required",
"VAPID",
"parameters",
"and",
"returns",
"the",
"required",
"header",
"to",
"be",
"added",
"to",
"a",
"Web",
"Push",
"Protocol",
"Request",
"."
] | b1e09e93fbbf3d4f95cee79a61191bd9df9f8f27 | https://github.com/web-push-libs/web-push-php/blob/b1e09e93fbbf3d4f95cee79a61191bd9df9f8f27/src/VAPID.php#L113-L167 | train |
web-push-libs/web-push-php | src/VAPID.php | VAPID.createVapidKeys | public static function createVapidKeys(): array
{
$curve = NistCurve::curve256();
$privateKey = $curve->createPrivateKey();
$publicKey = $curve->createPublicKey($privateKey);
$binaryPublicKey = hex2bin(Utils::serializePublicKey($publicKey));
if (!$binaryPublicKey) {
... | php | public static function createVapidKeys(): array
{
$curve = NistCurve::curve256();
$privateKey = $curve->createPrivateKey();
$publicKey = $curve->createPublicKey($privateKey);
$binaryPublicKey = hex2bin(Utils::serializePublicKey($publicKey));
if (!$binaryPublicKey) {
... | [
"public",
"static",
"function",
"createVapidKeys",
"(",
")",
":",
"array",
"{",
"$",
"curve",
"=",
"NistCurve",
"::",
"curve256",
"(",
")",
";",
"$",
"privateKey",
"=",
"$",
"curve",
"->",
"createPrivateKey",
"(",
")",
";",
"$",
"publicKey",
"=",
"$",
... | This method creates VAPID keys in case you would not be able to have a Linux bash.
DO NOT create keys at each initialization! Save those keys and reuse them.
@return array
@throws \ErrorException | [
"This",
"method",
"creates",
"VAPID",
"keys",
"in",
"case",
"you",
"would",
"not",
"be",
"able",
"to",
"have",
"a",
"Linux",
"bash",
".",
"DO",
"NOT",
"create",
"keys",
"at",
"each",
"initialization!",
"Save",
"those",
"keys",
"and",
"reuse",
"them",
"."... | b1e09e93fbbf3d4f95cee79a61191bd9df9f8f27 | https://github.com/web-push-libs/web-push-php/blob/b1e09e93fbbf3d4f95cee79a61191bd9df9f8f27/src/VAPID.php#L176-L196 | train |
web-push-libs/web-push-php | src/WebPush.php | WebPush.flush | public function flush(?int $batchSize = null): \Generator
{
if (null === $this->notifications || empty($this->notifications)) {
yield from [];
return;
}
if (null === $batchSize) {
$batchSize = $this->defaultOptions['batchSize'];
}
$batche... | php | public function flush(?int $batchSize = null): \Generator
{
if (null === $this->notifications || empty($this->notifications)) {
yield from [];
return;
}
if (null === $batchSize) {
$batchSize = $this->defaultOptions['batchSize'];
}
$batche... | [
"public",
"function",
"flush",
"(",
"?",
"int",
"$",
"batchSize",
"=",
"null",
")",
":",
"\\",
"Generator",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"notifications",
"||",
"empty",
"(",
"$",
"this",
"->",
"notifications",
")",
")",
"{",
"yie... | Flush notifications. Triggers the requests.
@param null|int $batchSize Defaults the value defined in defaultOptions during instantiation (which defaults to 1000).
@return \Generator|MessageSentReport[]
@throws \ErrorException | [
"Flush",
"notifications",
".",
"Triggers",
"the",
"requests",
"."
] | b1e09e93fbbf3d4f95cee79a61191bd9df9f8f27 | https://github.com/web-push-libs/web-push-php/blob/b1e09e93fbbf3d4f95cee79a61191bd9df9f8f27/src/WebPush.php#L150-L192 | train |
appzcoder/crud-generator | src/Commands/CrudModelCommand.php | CrudModelCommand.createRelationshipFunction | protected function createRelationshipFunction(&$stub, $relationshipName, $relationshipType, $argsString)
{
$tabIndent = ' ';
$code = "public function " . $relationshipName . "()\n" . $tabIndent . "{\n" . $tabIndent . $tabIndent
. "return \$this->" . $relationshipType . "(" . $argsStri... | php | protected function createRelationshipFunction(&$stub, $relationshipName, $relationshipType, $argsString)
{
$tabIndent = ' ';
$code = "public function " . $relationshipName . "()\n" . $tabIndent . "{\n" . $tabIndent . $tabIndent
. "return \$this->" . $relationshipType . "(" . $argsStri... | [
"protected",
"function",
"createRelationshipFunction",
"(",
"&",
"$",
"stub",
",",
"$",
"relationshipName",
",",
"$",
"relationshipType",
",",
"$",
"argsString",
")",
"{",
"$",
"tabIndent",
"=",
"' '",
";",
"$",
"code",
"=",
"\"public function \"",
".",
"$"... | Create the code for a model relationship
@param string $stub
@param string $relationshipName the name of the function, e.g. owners
@param string $relationshipType the type of the relationship, hasOne, hasMany, belongsTo etc
@param array $relationshipArgs args for the relationship function | [
"Create",
"the",
"code",
"for",
"a",
"model",
"relationship"
] | e086cdb6a9497ddb80c849626aa22ab1e379b4a4 | https://github.com/appzcoder/crud-generator/blob/e086cdb6a9497ddb80c849626aa22ab1e379b4a4/src/Commands/CrudModelCommand.php#L198-L209 | train |
appzcoder/crud-generator | src/Commands/CrudApiCommand.php | CrudApiCommand.processJSONForeignKeys | protected function processJSONForeignKeys($file)
{
$json = File::get($file);
$fields = json_decode($json);
if (! property_exists($fields, 'foreign_keys')) {
return '';
}
$foreignKeysString = '';
foreach ($fields->foreign_keys as $foreign_key) {
... | php | protected function processJSONForeignKeys($file)
{
$json = File::get($file);
$fields = json_decode($json);
if (! property_exists($fields, 'foreign_keys')) {
return '';
}
$foreignKeysString = '';
foreach ($fields->foreign_keys as $foreign_key) {
... | [
"protected",
"function",
"processJSONForeignKeys",
"(",
"$",
"file",
")",
"{",
"$",
"json",
"=",
"File",
"::",
"get",
"(",
"$",
"file",
")",
";",
"$",
"fields",
"=",
"json_decode",
"(",
"$",
"json",
")",
";",
"if",
"(",
"!",
"property_exists",
"(",
"... | Process the JSON Foreign keys.
@param string $file
@return string | [
"Process",
"the",
"JSON",
"Foreign",
"keys",
"."
] | e086cdb6a9497ddb80c849626aa22ab1e379b4a4 | https://github.com/appzcoder/crud-generator/blob/e086cdb6a9497ddb80c849626aa22ab1e379b4a4/src/Commands/CrudApiCommand.php#L190-L217 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.