_id stringlengths 2 7 | title stringlengths 3 151 | partition stringclasses 3
values | text stringlengths 33 8k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q17000 | ApiLoader.loadExternalFiles | train | private function loadExternalFiles(RouteCollection $routeCollection): void
{
if ($this->entrypointEnabled) {
$routeCollection->addCollection($this->fileLoader->load('api.xml'));
}
if ($this->docsEnabled) {
$routeCollection->addCollection($this->fileLoader->load('docs... | php | {
"resource": ""
} |
q17001 | ApiLoader.addRoute | train | private function addRoute(RouteCollection $routeCollection, string $resourceClass, string $operationName, array $operation, ResourceMetadata $resourceMetadata, string $operationType): void
{
$resourceShortName = $resourceMetadata->getShortName();
if (isset($operation['route_name'])) {
r... | php | {
"resource": ""
} |
q17002 | PropertyHelperTrait.isPropertyMapped | train | protected function isPropertyMapped(string $property, string $resourceClass, bool $allowAssociation = false): bool
{
if ($this->isPropertyNested($property, $resourceClass)) {
$propertyParts = $this->splitPropertyParts($property, $resourceClass);
$metadata = $this->getNestedMetadata($... | php | {
"resource": ""
} |
q17003 | PropertyHelperTrait.isPropertyNested | train | protected function isPropertyNested(string $property/*, string $resourceClass*/): bool
{
if (\func_num_args() > 1) {
$resourceClass = (string) func_get_arg(1);
} else {
if (__CLASS__ !== \get_class($this)) {
$r = new \ReflectionMethod($this, __FUNCTION__);
... | php | {
"resource": ""
} |
q17004 | PropertyHelperTrait.isPropertyEmbedded | train | protected function isPropertyEmbedded(string $property, string $resourceClass): bool
{
return false !== strpos($property, '.') | php | {
"resource": ""
} |
q17005 | PropertyHelperTrait.splitPropertyParts | train | protected function splitPropertyParts(string $property/*, string $resourceClass*/): array
{
$resourceClass = null;
$parts = explode('.', $property);
if (\func_num_args() > 1) {
$resourceClass = func_get_arg(1);
} elseif (__CLASS__ !== \get_class($this)) {
$r ... | php | {
"resource": ""
} |
q17006 | PropertyHelperTrait.getNestedMetadata | train | protected function getNestedMetadata(string $resourceClass, array $associations): ClassMetadata
{
$metadata = $this->getClassMetadata($resourceClass);
foreach ($associations as $association) { | php | {
"resource": ""
} |
q17007 | ApiPlatformParser.getGroupsForItemAndCollectionOperation | train | private function getGroupsForItemAndCollectionOperation(ResourceMetadata $resourceMetadata, string $operationName, string $io): array
{
$operation = $this->getGroupsContext($resourceMetadata, $operationName, true);
$operation += $this->getGroupsContext($resourceMetadata, $operationName, false);
... | php | {
"resource": ""
} |
q17008 | ApiPlatformParser.getPropertyMetadata | train | private function getPropertyMetadata(ResourceMetadata $resourceMetadata, string $resourceClass, string $io, array $visited, array $options): array
{
$data = [];
foreach ($this->propertyNameCollectionFactory->create($resourceClass, $options) as $propertyName) {
$propertyMetadata = $this-... | php | {
"resource": ""
} |
q17009 | PublishMercureUpdatesListener.onFlush | train | public function onFlush(OnFlushEventArgs $eventArgs): void
{
$uow = $eventArgs->getEntityManager()->getUnitOfWork();
foreach ($uow->getScheduledEntityInsertions() as $entity) {
$this->storeEntityToPublish($entity, 'createdEntities');
}
foreach ($uow->getScheduledEntityU... | php | {
"resource": ""
} |
q17010 | PublishMercureUpdatesListener.postFlush | train | public function postFlush(): void
{
try {
foreach ($this->createdEntities as $entity) {
$this->publishUpdate($entity, $this->createdEntities[$entity]);
}
foreach ($this->updatedEntities as $entity) {
$this->publishUpdate($entity, $this->up... | php | {
"resource": ""
} |
q17011 | RangeFilterTrait.getFilterDescription | train | protected function getFilterDescription(string $fieldName, string $operator): array
{
return [
sprintf('%s[%s]', $fieldName, $operator) | php | {
"resource": ""
} |
q17012 | RangeFilterTrait.normalizeBetweenValues | train | private function normalizeBetweenValues(array $values): ?array
{
if (2 !== \count($values)) {
$this->getLogger()->notice('Invalid filter ignored', [
'exception' => new InvalidArgumentException(sprintf('Invalid format for "[%s]", expected "<min>..<max>"', self::PARAMETER_BETWEEN))... | php | {
"resource": ""
} |
q17013 | RangeFilterTrait.normalizeValue | train | private function normalizeValue(string $value, string $operator)
{
if (!is_numeric($value)) {
$this->getLogger()->notice('Invalid filter ignored', [
'exception' | php | {
"resource": ""
} |
q17014 | ResourceMetadata.withShortName | train | public function withShortName(string $shortName): self
{
$metadata = clone $this;
| php | {
"resource": ""
} |
q17015 | ResourceMetadata.withIri | train | public function withIri(string $iri): self
{
$metadata = clone $this;
| php | {
"resource": ""
} |
q17016 | ResourceMetadata.getCollectionOperationAttribute | train | public function getCollectionOperationAttribute(?string $operationName, string $key, $defaultValue = null, bool $resourceFallback = | php | {
"resource": ""
} |
q17017 | ResourceMetadata.getItemOperationAttribute | train | public function getItemOperationAttribute(?string $operationName, string $key, $defaultValue = null, bool $resourceFallback = | php | {
"resource": ""
} |
q17018 | ResourceMetadata.getSubresourceOperationAttribute | train | public function getSubresourceOperationAttribute(?string $operationName, string $key, $defaultValue = null, bool $resourceFallback = | php | {
"resource": ""
} |
q17019 | ResourceMetadata.getTypedOperationAttribute | train | 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 | {
"resource": ""
} |
q17020 | ResourceMetadata.findOperationAttribute | train | private function findOperationAttribute(?array $operations, ?string $operationName, string $key, $defaultValue, bool $resourceFallback)
{
if (null !== $operationName && isset($operations[$operationName][$key])) { | php | {
"resource": ""
} |
q17021 | DocumentationNormalizer.populateEntrypointProperties | train | private function populateEntrypointProperties(string $resourceClass, ResourceMetadata $resourceMetadata, string $shortName, string $prefixedShortName, array &$entrypointProperties)
{
$hydraCollectionOperations = $this->getHydraOperations($resourceClass, $resourceMetadata, $prefixedShortName, true);
... | php | {
"resource": ""
} |
q17022 | DocumentationNormalizer.getClass | train | 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 | {
"resource": ""
} |
q17023 | DocumentationNormalizer.getPropertyNameCollectionFactoryContext | train | private function getPropertyNameCollectionFactoryContext(ResourceMetadata $resourceMetadata): array
{
$attributes = $resourceMetadata->getAttributes();
$context = [];
if (isset($attributes['normalization_context'][AbstractNormalizer::GROUPS])) {
$context['serializer_groups'] = (... | php | {
"resource": ""
} |
q17024 | DocumentationNormalizer.getHydraProperties | train | private function getHydraProperties(string $resourceClass, ResourceMetadata $resourceMetadata, string $shortName, string $prefixedShortName, array $context): array
{
$classes = [];
foreach ($resourceMetadata->getCollectionOperations() as $operationName => $operation) {
$inputMetadata = $... | php | {
"resource": ""
} |
q17025 | DocumentationNormalizer.getHydraOperations | train | private function getHydraOperations(string $resourceClass, ResourceMetadata $resourceMetadata, string $prefixedShortName, bool $collection): array
{
if (null === $operations = $collection ? $resourceMetadata->getCollectionOperations() : $resourceMetadata->getItemOperations()) {
return [];
... | php | {
"resource": ""
} |
q17026 | DocumentationNormalizer.getRange | train | private function getRange(PropertyMetadata $propertyMetadata): ?string
{
$jsonldContext = $propertyMetadata->getAttributes()['jsonld_context'] ?? [];
if (isset($jsonldContext['@type'])) {
return $jsonldContext['@type'];
}
if (null === $type = $propertyMetadata->getType(... | php | {
"resource": ""
} |
q17027 | DocumentationNormalizer.getClasses | train | 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 | {
"resource": ""
} |
q17028 | DocumentationNormalizer.getProperty | train | private function getProperty(PropertyMetadata $propertyMetadata, string $propertyName, string $prefixedShortName, string $shortName): array
{
$propertyData = [
'@id' => $propertyMetadata->getIri() ?? "#$shortName/$propertyName",
'@type' => $propertyMetadata->isReadableLink() ? 'rdf:P... | php | {
"resource": ""
} |
q17029 | DocumentationNormalizer.computeDoc | train | 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 | {
"resource": ""
} |
q17030 | DocumentationNormalizer.getContext | train | 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 | {
"resource": ""
} |
q17031 | AbstractSearchFilter.isIdentifier | train | protected function isIdentifier(string $resourceClass, string $property): bool
| php | {
"resource": ""
} |
q17032 | DataPersister.getManager | train | private function getManager($data): ?DoctrineObjectManager
{
return \is_object($data) ? | php | {
"resource": ""
} |
q17033 | DataPersister.isDeferredExplicit | train | private function isDeferredExplicit(DoctrineObjectManager $manager, $data): bool
{
$classMetadata = $manager->getClassMetadata($this->getObjectClass($data));
if | php | {
"resource": ""
} |
q17034 | PurgeHttpCacheListener.preUpdate | train | public function preUpdate(PreUpdateEventArgs $eventArgs): void
{
$object = $eventArgs->getObject();
$this->gatherResourceAndItemTags($object, true);
$changeSet = $eventArgs->getEntityChangeSet();
$associationMappings = $eventArgs->getEntityManager()->getClassMetadata(ClassUtils::get... | php | {
"resource": ""
} |
q17035 | PurgeHttpCacheListener.onFlush | train | 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 | {
"resource": ""
} |
q17036 | PurgeHttpCacheListener.postFlush | train | public function postFlush(): void
{
if (empty($this->tags)) {
| php | {
"resource": ""
} |
q17037 | AddTagsListener.onKernelResponse | train | public function onKernelResponse(FilterResponseEvent $event): void
{
$request = $event->getRequest();
$response = $event->getResponse();
if (
!$request->isMethodCacheable()
|| !$response->isCacheable()
|| (!$attributes = RequestAttributesExtractor::extrac... | php | {
"resource": ""
} |
q17038 | RangeFilter.addMatch | train | 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 | {
"resource": ""
} |
q17039 | DateFilter.addWhere | train | 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 | {
"resource": ""
} |
q17040 | QueryBuilderHelper.addJoinOnce | train | 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 | {
"resource": ""
} |
q17041 | QueryBuilderHelper.getEntityClassByAlias | train | 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 | {
"resource": ""
} |
q17042 | QueryBuilderHelper.findRootAlias | train | 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) | php | {
"resource": ""
} |
q17043 | QueryBuilderHelper.traverseJoins | train | public static function traverseJoins(string $alias, QueryBuilder $queryBuilder, ManagerRegistry $managerRegistry): \Generator
{
$rootAliasMap = self::mapRootAliases($queryBuilder->getRootAliases(), $queryBuilder->getRootEntities());
$joinParts = $queryBuilder->getDQLPart('join');
$rootAlias... | php | {
"resource": ""
} |
q17044 | QueryBuilderHelper.getExistingJoin | train | 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 | {
"resource": ""
} |
q17045 | QueryBuilderHelper.mapRootAliases | train | private static function mapRootAliases(array $rootAliases, array $rootEntities): array
{
$aliasMap = array_combine($rootAliases, $rootEntities);
if (false === $aliasMap) {
| php | {
"resource": ""
} |
q17046 | QueryBuilderHelper.mapJoinAliases | train | private static function mapJoinAliases(iterable $joins): array
{
$aliasMap = [];
foreach ($joins as $join) {
$alias = $join->getAlias();
$relationship = $join->getJoin();
if (false !== strpos($relationship, '.')) {
| php | {
"resource": ""
} |
q17047 | FormatsProvider.getOperationFormats | train | private function getOperationFormats(array $annotationFormats): array
{
$resourceFormats = [];
foreach ($annotationFormats as $format => $value) {
if (!is_numeric($format)) {
$resourceFormats[$format] = (array) $value;
continue;
}
i... | php | {
"resource": ""
} |
q17048 | FieldDatatypeTrait.isNestedField | train | private function isNestedField(string $resourceClass, string $property): bool | php | {
"resource": ""
} |
q17049 | EagerLoadingTrait.shouldOperationForceEager | train | private function shouldOperationForceEager(string $resourceClass, array $options): bool
{
| php | {
"resource": ""
} |
q17050 | EagerLoadingTrait.shouldOperationFetchPartial | train | private function shouldOperationFetchPartial(string $resourceClass, array $options): bool
{
| php | {
"resource": ""
} |
q17051 | EagerLoadingTrait.getBooleanOperationAttribute | train | 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 | {
"resource": ""
} |
q17052 | EagerLoadingTrait.hasFetchEagerAssociation | train | 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 | {
"resource": ""
} |
q17053 | IdentifierManagerTrait.normalizeIdentifiers | train | private function normalizeIdentifiers($id, ObjectManager $manager, string $resourceClass): array
{
$identifierValues = [$id];
$doctrineClassMetadata = $manager->getClassMetadata($resourceClass);
$doctrineIdentifierFields = $doctrineClassMetadata->getIdentifier();
$isOrm = $manager in... | php | {
"resource": ""
} |
q17054 | BaseEvent.getGroupId | train | public function getGroupId()
{
if (!$this->isGroupEvent()) {
throw new InvalidEventSourceException('This event source is not a group type');
}
| php | {
"resource": ""
} |
q17055 | BaseEvent.getRoomId | train | public function getRoomId()
{
if (!$this->isRoomEvent()) {
throw new InvalidEventSourceException('This event source is not a room type');
}
| php | {
"resource": ""
} |
q17056 | LocationMessageBuilder.buildMessage | train | public function buildMessage()
{
if (!empty($this->message)) {
return $this->message;
}
$locationMessage = [
'type' => MessageType::LOCATION,
'title' => $this->title,
| php | {
"resource": ""
} |
q17057 | LINEBot.replyMessage | train | public function replyMessage($replyToken, MessageBuilder $messageBuilder)
{
return $this->httpClient->post($this->endpointBase . | php | {
"resource": ""
} |
q17058 | LINEBot.pushMessage | train | public function pushMessage($to, MessageBuilder $messageBuilder)
{
return $this->httpClient->post($this->endpointBase . | php | {
"resource": ""
} |
q17059 | LINEBot.multicast | train | public function multicast(array $tos, MessageBuilder $messageBuilder)
{
return $this->httpClient->post($this->endpointBase . | php | {
"resource": ""
} |
q17060 | LINEBot.parseEventRequest | train | public function parseEventRequest($body, $signature, $eventOnly = true)
{
return | php | {
"resource": ""
} |
q17061 | LINEBot.getGroupMemberProfile | train | public function getGroupMemberProfile($groupId, $userId)
{
$url = sprintf('%s/v2/bot/group/%s/member/%s', $this->endpointBase, urlencode($groupId), | php | {
"resource": ""
} |
q17062 | LINEBot.getRoomMemberProfile | train | public function getRoomMemberProfile($roomId, $userId)
{
$url = sprintf('%s/v2/bot/room/%s/member/%s', $this->endpointBase, urlencode($roomId), | php | {
"resource": ""
} |
q17063 | LINEBot.getGroupMemberIds | train | public function getGroupMemberIds($groupId, $start = null)
{
$url = sprintf('%s/v2/bot/group/%s/members/ids', $this->endpointBase, urlencode($groupId));
| php | {
"resource": ""
} |
q17064 | LINEBot.getRoomMemberIds | train | public function getRoomMemberIds($roomId, $start = null)
{
$url = sprintf('%s/v2/bot/room/%s/members/ids', $this->endpointBase, urlencode($roomId));
| php | {
"resource": ""
} |
q17065 | LINEBot.createLinkToken | train | public function createLinkToken($userId)
{
$url = sprintf('%s/v2/bot/user/%s/linkToken', | php | {
"resource": ""
} |
q17066 | LINEBot.deleteRichMenu | train | public function deleteRichMenu($richMenuId)
{
$url = sprintf('%s/v2/bot/richmenu/%s', | php | {
"resource": ""
} |
q17067 | LINEBot.getRichMenuId | train | public function getRichMenuId($userId)
{
$url = sprintf('%s/v2/bot/user/%s/richmenu', | php | {
"resource": ""
} |
q17068 | LINEBot.linkRichMenu | train | public function linkRichMenu($userId, $richMenuId)
{
$url = sprintf(
'%s/v2/bot/user/%s/richmenu/%s',
$this->endpointBase,
urlencode($userId),
| php | {
"resource": ""
} |
q17069 | LINEBot.bulkLinkRichMenu | train | public function bulkLinkRichMenu($userIds, $richMenuId)
{
$url = $this->endpointBase . '/v2/bot/richmenu/bulk/link';
return $this->httpClient->post($url, [
| php | {
"resource": ""
} |
q17070 | LINEBot.unlinkRichMenu | train | public function unlinkRichMenu($userId)
{
$url = sprintf('%s/v2/bot/user/%s/richmenu', | php | {
"resource": ""
} |
q17071 | LINEBot.bulkUnlinkRichMenu | train | public function bulkUnlinkRichMenu($userIds)
{
$url = $this->endpointBase . '/v2/bot/richmenu/bulk/unlink';
| php | {
"resource": ""
} |
q17072 | LINEBot.downloadRichMenuImage | train | public function downloadRichMenuImage($richMenuId)
{
$url = sprintf('%s/v2/bot/richmenu/%s/content', | php | {
"resource": ""
} |
q17073 | LINEBot.uploadRichMenuImage | train | public function uploadRichMenuImage($richMenuId, $imagePath, $contentType)
{
$url = sprintf('%s/v2/bot/richmenu/%s/content', $this->endpointBase, urlencode($richMenuId));
return $this->httpClient->post(
$url,
[ | php | {
"resource": ""
} |
q17074 | LINEBot.getNumberOfSentReplyMessages | train | public function getNumberOfSentReplyMessages(DateTime $datetime)
{
$url = $this->endpointBase . '/v2/bot/message/delivery/reply';
$datetime->setTimezone(new | php | {
"resource": ""
} |
q17075 | BlockStyleBuilder.build | train | public function build()
{
if (isset($this->style)) {
return $this->style;
}
$this->style = BuildUtil::removeNullElements([
'backgroundColor' => $this->backgroundColor,
| php | {
"resource": ""
} |
q17076 | ImageComponentBuilder.build | train | 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 | {
"resource": ""
} |
q17077 | TextComponentBuilder.build | train | 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 | {
"resource": ""
} |
q17078 | CarouselColumnTemplateBuilder.buildTemplate | train | public function buildTemplate()
{
if (!empty($this->template)) {
return $this->template;
}
$actions = [];
foreach ($this->actionBuilders as $actionBuilder) {
$actions[] = $actionBuilder->buildTemplateAction();
}
$this->template = [
... | php | {
"resource": ""
} |
q17079 | BubbleContainerBuilder.build | train | 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 | {
"resource": ""
} |
q17080 | ButtonTemplateBuilder.buildTemplate | train | public function buildTemplate()
{
if (!empty($this->template)) {
return $this->template;
}
$actions = [];
foreach ($this->actionBuilders as $actionBuilder) {
$actions[] = $actionBuilder->buildTemplateAction();
}
$this->template = [
... | php | {
"resource": ""
} |
q17081 | SeparatorComponentBuilder.build | train | public function build()
{
if (isset($this->component)) {
return $this->component;
}
$this->component = BuildUtil::removeNullElements([
'type' => ComponentType::SEPARATOR,
| php | {
"resource": ""
} |
q17082 | TextMessageBuilder.buildMessage | train | 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 | {
"resource": ""
} |
q17083 | BubbleStylesBuilder.build | train | public function build()
{
if (isset($this->styles)) {
return $this->styles;
}
$this->styles = BuildUtil::removeNullElements([
'header' => BuildUtil::build($this->headerStyleBuilder),
'hero' => BuildUtil::build($this->heroStyleBuilder),
| php | {
"resource": ""
} |
q17084 | StickerMessageBuilder.buildMessage | train | public function buildMessage()
{
if (!empty($this->message)) {
return $this->message;
}
$sticker = [
'type' => MessageType::STICKER,
'packageId' => $this->packageId,
'stickerId' => $this->stickerId,
];
| php | {
"resource": ""
} |
q17085 | VideoBuilder.build | train | public function build()
{
$video = [
'originalContentUrl' => $this->originalContentUrl,
'previewImageUrl' => $this->previewImageUrl,
| php | {
"resource": ""
} |
q17086 | AudioMessageBuilder.buildMessage | train | public function buildMessage()
{
if (!empty($this->message)) {
return $this->message;
}
$audioMessage = [
'type' => MessageType::AUDIO,
'originalContentUrl' => $this->originalContentUrl,
'duration' => $this->duration,
];
if | php | {
"resource": ""
} |
q17087 | ImageMessageBuilder.buildMessage | train | public function buildMessage()
{
if (!empty($this->message)) {
return $this->message;
}
$imageMessage = [
'type' => MessageType::IMAGE,
'originalContentUrl' => $this->originalContentUrl,
'previewImageUrl' => $this->previewImageUrl,
];
... | php | {
"resource": ""
} |
q17088 | ConfirmTemplateBuilder.buildTemplate | train | public function buildTemplate()
{
if (!empty($this->template)) {
return $this->template;
}
$actions = [];
foreach ($this->actionBuilders as $actionBuilder) {
$actions[] = $actionBuilder->buildTemplateAction();
}
$this->template = | php | {
"resource": ""
} |
q17089 | CurlHTTPClient.get | train | public function get($url, array $data = [], array $headers = [])
{
if ($data) {
$url .= '?' . http_build_query($data); | php | {
"resource": ""
} |
q17090 | CurlHTTPClient.post | train | public function post($url, array $data, array $headers = null)
{
$headers = is_null($headers) ? ['Content-Type: application/json; charset=utf-8'] | php | {
"resource": ""
} |
q17091 | ImageCarouselColumnTemplateBuilder.buildTemplate | train | public function buildTemplate()
{
if (!empty($this->template)) {
return $this->template;
}
$this->template = [
'imageUrl' => $this->imageUrl,
| php | {
"resource": ""
} |
q17092 | DatetimePickerTemplateActionBuilder.buildTemplateAction | train | public function buildTemplateAction()
{
return [
'type' => ActionType::DATETIME_PICKER,
'label' => $this->label,
'data' => $this->data,
'mode' => $this->mode,
| php | {
"resource": ""
} |
q17093 | UriTemplateActionBuilder.buildTemplateAction | train | public function buildTemplateAction()
{
$templateAction = BuildUtil::removeNullElements([
'type' => ActionType::URI,
'label' => $this->label,
'uri' => $this->uri,
]);
| php | {
"resource": ""
} |
q17094 | SignatureValidator.validateSignature | train | public static function validateSignature($body, $channelSecret, $signature)
{
if (!isset($signature)) {
throw new InvalidSignatureException('Signature must not be empty');
}
| php | {
"resource": ""
} |
q17095 | IconComponentBuilder.build | train | public function build()
{
if (isset($this->component)) {
return $this->component;
}
$this->component = BuildUtil::removeNullElements([
'type' => ComponentType::ICON,
'url' => $this->url,
| php | {
"resource": ""
} |
q17096 | SpacerComponentBuilder.build | train | public function build()
{
if (isset($this->component)) {
return $this->component;
}
$this->component = BuildUtil::removeNullElements([
'type' | php | {
"resource": ""
} |
q17097 | FlexSampleShopping.get | train | public static function get()
{
return FlexMessageBuilder::builder()
->setAltText('Shopping')
->setContents(new CarouselContainerBuilder([
self::createItemBubble(111), | php | {
"resource": ""
} |
q17098 | QuickReplyMessageBuilder.buildQuickReply | train | public function buildQuickReply()
{
if (!empty($this->quickReply)) {
return $this->quickReply;
}
$items = [];
foreach ($this->buttonBuilders as $buttonBuilder) {
| php | {
"resource": ""
} |
q17099 | BoxComponentBuilder.build | train | public function build()
{
if (isset($this->component)) {
return $this->component;
}
$contents = array_map(function ($componentBuilder) {
/** @var ComponentBuilder $componentBuilder */
return $componentBuilder->build();
}, $this->componentBuilders)... | php | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.