repository_name stringlengths 5 67 | func_path_in_repository stringlengths 4 234 | func_name stringlengths 0 314 | whole_func_string stringlengths 52 3.87M | language stringclasses 6
values | func_code_string stringlengths 52 3.87M | func_code_tokens listlengths 15 672k | func_documentation_string stringlengths 1 47.2k | func_documentation_tokens listlengths 1 3.92k | split_name stringclasses 1
value | func_code_url stringlengths 85 339 |
|---|---|---|---|---|---|---|---|---|---|---|
shopware/platform | src/Core/Framework/Demodata/Generator/MailHeaderFooterGenerator.php | MailHeaderFooterGenerator.generateRandomHTML | private function generateRandomHTML(int $count, array $tags, DemodataContext $context)
{
$output = '';
for ($i = 0; $i < $count; ++$i) {
$tag = Random::getRandomArrayElement($tags);
$text = $context->getFaker()->words(random_int(1, 10), true);
$output .= sprintf('... | php | private function generateRandomHTML(int $count, array $tags, DemodataContext $context)
{
$output = '';
for ($i = 0; $i < $count; ++$i) {
$tag = Random::getRandomArrayElement($tags);
$text = $context->getFaker()->words(random_int(1, 10), true);
$output .= sprintf('... | [
"private",
"function",
"generateRandomHTML",
"(",
"int",
"$",
"count",
",",
"array",
"$",
"tags",
",",
"DemodataContext",
"$",
"context",
")",
"{",
"$",
"output",
"=",
"''",
";",
"for",
"(",
"$",
"i",
"=",
"0",
";",
"$",
"i",
"<",
"$",
"count",
";"... | @throws \Exception
@return string | [
"@throws",
"\\",
"Exception"
] | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Framework/Demodata/Generator/MailHeaderFooterGenerator.php#L115-L126 |
shopware/platform | src/Core/Framework/Api/OAuth/ClientRepository.php | ClientRepository.getClientEntity | public function getClientEntity($clientIdentifier, $grantType = null, $clientSecret = null, $mustValidateSecret = true): ?ClientEntityInterface
{
if ($grantType === 'password' && $clientIdentifier === 'administration') {
return new ApiClient('administration', true);
}
if ($grant... | php | public function getClientEntity($clientIdentifier, $grantType = null, $clientSecret = null, $mustValidateSecret = true): ?ClientEntityInterface
{
if ($grantType === 'password' && $clientIdentifier === 'administration') {
return new ApiClient('administration', true);
}
if ($grant... | [
"public",
"function",
"getClientEntity",
"(",
"$",
"clientIdentifier",
",",
"$",
"grantType",
"=",
"null",
",",
"$",
"clientSecret",
"=",
"null",
",",
"$",
"mustValidateSecret",
"=",
"true",
")",
":",
"?",
"ClientEntityInterface",
"{",
"if",
"(",
"$",
"grant... | Get a client.
@param string $clientIdentifier The client's identifier
@param string|null $grantType The grant type used (if sent)
@param string|null $clientSecret The client's secret (if sent)
@param bool $mustValidateSecret If true the client must attempt to validate the secret if the cli... | [
"Get",
"a",
"client",
"."
] | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Framework/Api/OAuth/ClientRepository.php#L34-L49 |
shopware/platform | src/Core/Framework/Api/OAuth/UserRepository.php | UserRepository.getUserEntityByUserCredentials | public function getUserEntityByUserCredentials(
$username,
$password,
$grantType,
ClientEntityInterface $clientEntity
): ?UserEntityInterface {
$builder = $this->connection->createQueryBuilder();
$user = $builder->select(['user.id', 'user.password'])
->fro... | php | public function getUserEntityByUserCredentials(
$username,
$password,
$grantType,
ClientEntityInterface $clientEntity
): ?UserEntityInterface {
$builder = $this->connection->createQueryBuilder();
$user = $builder->select(['user.id', 'user.password'])
->fro... | [
"public",
"function",
"getUserEntityByUserCredentials",
"(",
"$",
"username",
",",
"$",
"password",
",",
"$",
"grantType",
",",
"ClientEntityInterface",
"$",
"clientEntity",
")",
":",
"?",
"UserEntityInterface",
"{",
"$",
"builder",
"=",
"$",
"this",
"->",
"conn... | Get a user entity.
@param string $username
@param string $password
@param string $grantType The grant type used | [
"Get",
"a",
"user",
"entity",
"."
] | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Framework/Api/OAuth/UserRepository.php#L31-L54 |
shopware/platform | src/Core/Framework/Api/Controller/InfoController.php | InfoController.info | public function info(): JsonResponse
{
$data = $this->definitionService->generate(OpenApi3Generator::FORMAT);
return $this->json($data);
} | php | public function info(): JsonResponse
{
$data = $this->definitionService->generate(OpenApi3Generator::FORMAT);
return $this->json($data);
} | [
"public",
"function",
"info",
"(",
")",
":",
"JsonResponse",
"{",
"$",
"data",
"=",
"$",
"this",
"->",
"definitionService",
"->",
"generate",
"(",
"OpenApi3Generator",
"::",
"FORMAT",
")",
";",
"return",
"$",
"this",
"->",
"json",
"(",
"$",
"data",
")",
... | @Route("/api/v{version}/_info/openapi3.json", defaults={"auth_required"=false}, name="api.info.openapi3", methods={"GET"})
@throws \Exception | [
"@Route",
"(",
"/",
"api",
"/",
"v",
"{",
"version",
"}",
"/",
"_info",
"/",
"openapi3",
".",
"json",
"defaults",
"=",
"{",
"auth_required",
"=",
"false",
"}",
"name",
"=",
"api",
".",
"info",
".",
"openapi3",
"methods",
"=",
"{",
"GET",
"}",
")"
] | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Framework/Api/Controller/InfoController.php#L44-L49 |
shopware/platform | src/Core/Content/Media/Commands/GenerateMediaTypesCommand.php | GenerateMediaTypesCommand.execute | protected function execute(InputInterface $input, OutputInterface $output)
{
$this->io = new SymfonyStyle($input, $output);
$context = Context::createDefaultContext();
$this->batchSize = $this->validateBatchSize($input);
$this->io->comment('Starting to generate MediaTypes. This may... | php | protected function execute(InputInterface $input, OutputInterface $output)
{
$this->io = new SymfonyStyle($input, $output);
$context = Context::createDefaultContext();
$this->batchSize = $this->validateBatchSize($input);
$this->io->comment('Starting to generate MediaTypes. This may... | [
"protected",
"function",
"execute",
"(",
"InputInterface",
"$",
"input",
",",
"OutputInterface",
"$",
"output",
")",
"{",
"$",
"this",
"->",
"io",
"=",
"new",
"SymfonyStyle",
"(",
"$",
"input",
",",
"$",
"output",
")",
";",
"$",
"context",
"=",
"Context"... | {@inheritdoc} | [
"{"
] | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Content/Media/Commands/GenerateMediaTypesCommand.php#L62-L75 |
shopware/platform | src/Core/Framework/DataAbstractionLayer/Write/EntityWriter.php | EntityWriter.delete | public function delete(EntityDefinition $definition, array $ids, WriteContext $writeContext): DeleteResult
{
$this->validateWriteInput($ids);
$commandQueue = new WriteCommandQueue();
$fields = $definition->getPrimaryKeys();
$resolved = [];
foreach ($ids as $raw) {
... | php | public function delete(EntityDefinition $definition, array $ids, WriteContext $writeContext): DeleteResult
{
$this->validateWriteInput($ids);
$commandQueue = new WriteCommandQueue();
$fields = $definition->getPrimaryKeys();
$resolved = [];
foreach ($ids as $raw) {
... | [
"public",
"function",
"delete",
"(",
"EntityDefinition",
"$",
"definition",
",",
"array",
"$",
"ids",
",",
"WriteContext",
"$",
"writeContext",
")",
":",
"DeleteResult",
"{",
"$",
"this",
"->",
"validateWriteInput",
"(",
"$",
"ids",
")",
";",
"$",
"commandQu... | @param array[] $ids
@throws RestrictDeleteViolationException
@throws IncompletePrimaryKeyException
@throws ImpossibleWriteOrderException | [
"@param",
"array",
"[]",
"$ids"
] | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Framework/DataAbstractionLayer/Write/EntityWriter.php#L97-L211 |
shopware/platform | src/Core/Framework/DataAbstractionLayer/Cache/EntityCacheKeyGenerator.php | EntityCacheKeyGenerator.getEntityContextCacheKey | public function getEntityContextCacheKey(string $id, EntityDefinition $definition, Context $context, ?Criteria $criteria = null): string
{
$keys = [$this->getDefinitionCacheKey($definition), $id, $this->getContextHash($context)];
if ($criteria && \count($criteria->getAssociations()) > 0) {
... | php | public function getEntityContextCacheKey(string $id, EntityDefinition $definition, Context $context, ?Criteria $criteria = null): string
{
$keys = [$this->getDefinitionCacheKey($definition), $id, $this->getContextHash($context)];
if ($criteria && \count($criteria->getAssociations()) > 0) {
... | [
"public",
"function",
"getEntityContextCacheKey",
"(",
"string",
"$",
"id",
",",
"EntityDefinition",
"$",
"definition",
",",
"Context",
"$",
"context",
",",
"?",
"Criteria",
"$",
"criteria",
"=",
"null",
")",
":",
"string",
"{",
"$",
"keys",
"=",
"[",
"$",... | Generates a unique entity cache key.
Considers a provided criteria with additional loaded associations and different context states. | [
"Generates",
"a",
"unique",
"entity",
"cache",
"key",
".",
"Considers",
"a",
"provided",
"criteria",
"with",
"additional",
"loaded",
"associations",
"and",
"different",
"context",
"states",
"."
] | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Framework/DataAbstractionLayer/Cache/EntityCacheKeyGenerator.php#L37-L46 |
shopware/platform | src/Core/Framework/DataAbstractionLayer/Cache/EntityCacheKeyGenerator.php | EntityCacheKeyGenerator.getReadCriteriaCacheKey | public function getReadCriteriaCacheKey(EntityDefinition $definition, Criteria $criteria, Context $context): string
{
$keys = [$this->getDefinitionCacheKey($definition), $this->getReadCriteriaHash($criteria), $this->getContextHash($context)];
return md5(implode('-', $keys));
} | php | public function getReadCriteriaCacheKey(EntityDefinition $definition, Criteria $criteria, Context $context): string
{
$keys = [$this->getDefinitionCacheKey($definition), $this->getReadCriteriaHash($criteria), $this->getContextHash($context)];
return md5(implode('-', $keys));
} | [
"public",
"function",
"getReadCriteriaCacheKey",
"(",
"EntityDefinition",
"$",
"definition",
",",
"Criteria",
"$",
"criteria",
",",
"Context",
"$",
"context",
")",
":",
"string",
"{",
"$",
"keys",
"=",
"[",
"$",
"this",
"->",
"getDefinitionCacheKey",
"(",
"$",... | Generates a cache key for a criteria inside the read process.
Considers different associations and context states. | [
"Generates",
"a",
"cache",
"key",
"for",
"a",
"criteria",
"inside",
"the",
"read",
"process",
".",
"Considers",
"different",
"associations",
"and",
"context",
"states",
"."
] | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Framework/DataAbstractionLayer/Cache/EntityCacheKeyGenerator.php#L52-L57 |
shopware/platform | src/Core/Framework/DataAbstractionLayer/Cache/EntityCacheKeyGenerator.php | EntityCacheKeyGenerator.getSearchCacheKey | public function getSearchCacheKey(EntityDefinition $definition, Criteria $criteria, Context $context): string
{
$keys = [$this->getDefinitionCacheKey($definition), $this->getCriteriaHash($criteria), $this->getContextHash($context)];
return md5(implode('-', $keys));
} | php | public function getSearchCacheKey(EntityDefinition $definition, Criteria $criteria, Context $context): string
{
$keys = [$this->getDefinitionCacheKey($definition), $this->getCriteriaHash($criteria), $this->getContextHash($context)];
return md5(implode('-', $keys));
} | [
"public",
"function",
"getSearchCacheKey",
"(",
"EntityDefinition",
"$",
"definition",
",",
"Criteria",
"$",
"criteria",
",",
"Context",
"$",
"context",
")",
":",
"string",
"{",
"$",
"keys",
"=",
"[",
"$",
"this",
"->",
"getDefinitionCacheKey",
"(",
"$",
"de... | Generates a unique cache key for a search result. | [
"Generates",
"a",
"unique",
"cache",
"key",
"for",
"a",
"search",
"result",
"."
] | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Framework/DataAbstractionLayer/Cache/EntityCacheKeyGenerator.php#L62-L67 |
shopware/platform | src/Core/Framework/DataAbstractionLayer/Cache/EntityCacheKeyGenerator.php | EntityCacheKeyGenerator.getAggregationCacheKey | public function getAggregationCacheKey(Aggregation $aggregation, EntityDefinition $definition, Criteria $criteria, Context $context): string
{
$keys = [
md5(json_encode($aggregation)),
$this->getDefinitionCacheKey($definition),
$this->getAggregationHash($criteria),
... | php | public function getAggregationCacheKey(Aggregation $aggregation, EntityDefinition $definition, Criteria $criteria, Context $context): string
{
$keys = [
md5(json_encode($aggregation)),
$this->getDefinitionCacheKey($definition),
$this->getAggregationHash($criteria),
... | [
"public",
"function",
"getAggregationCacheKey",
"(",
"Aggregation",
"$",
"aggregation",
",",
"EntityDefinition",
"$",
"definition",
",",
"Criteria",
"$",
"criteria",
",",
"Context",
"$",
"context",
")",
":",
"string",
"{",
"$",
"keys",
"=",
"[",
"md5",
"(",
... | Generates the unique cache key for the provided aggregation. Used as cache key for cached aggregation results. | [
"Generates",
"the",
"unique",
"cache",
"key",
"for",
"the",
"provided",
"aggregation",
".",
"Used",
"as",
"cache",
"key",
"for",
"cached",
"aggregation",
"results",
"."
] | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Framework/DataAbstractionLayer/Cache/EntityCacheKeyGenerator.php#L72-L82 |
shopware/platform | src/Core/Framework/DataAbstractionLayer/Cache/EntityCacheKeyGenerator.php | EntityCacheKeyGenerator.getEntityTag | public function getEntityTag(string $id, EntityDefinition $definition): string
{
$keys = [$definition->getEntityName(), $id];
return implode('-', $keys);
} | php | public function getEntityTag(string $id, EntityDefinition $definition): string
{
$keys = [$definition->getEntityName(), $id];
return implode('-', $keys);
} | [
"public",
"function",
"getEntityTag",
"(",
"string",
"$",
"id",
",",
"EntityDefinition",
"$",
"definition",
")",
":",
"string",
"{",
"$",
"keys",
"=",
"[",
"$",
"definition",
"->",
"getEntityName",
"(",
")",
",",
"$",
"id",
"]",
";",
"return",
"implode",... | Defines the tag for a single entity. Used for invalidation if this entity is written | [
"Defines",
"the",
"tag",
"for",
"a",
"single",
"entity",
".",
"Used",
"for",
"invalidation",
"if",
"this",
"entity",
"is",
"written"
] | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Framework/DataAbstractionLayer/Cache/EntityCacheKeyGenerator.php#L87-L92 |
shopware/platform | src/Core/Framework/DataAbstractionLayer/Cache/EntityCacheKeyGenerator.php | EntityCacheKeyGenerator.getSearchTags | public function getSearchTags(EntityDefinition $definition, Criteria $criteria): array
{
$tags = [$definition->getEntityName() . '.id'];
foreach ($criteria->getSearchQueryFields() as $accessor) {
foreach ($this->getFieldsOfAccessor($definition, $accessor) as $association) {
... | php | public function getSearchTags(EntityDefinition $definition, Criteria $criteria): array
{
$tags = [$definition->getEntityName() . '.id'];
foreach ($criteria->getSearchQueryFields() as $accessor) {
foreach ($this->getFieldsOfAccessor($definition, $accessor) as $association) {
... | [
"public",
"function",
"getSearchTags",
"(",
"EntityDefinition",
"$",
"definition",
",",
"Criteria",
"$",
"criteria",
")",
":",
"array",
"{",
"$",
"tags",
"=",
"[",
"$",
"definition",
"->",
"getEntityName",
"(",
")",
".",
"'.id'",
"]",
";",
"foreach",
"(",
... | Calculates all relevant cache tags for a search requests. Considers all accessed fields of the criteria. | [
"Calculates",
"all",
"relevant",
"cache",
"tags",
"for",
"a",
"search",
"requests",
".",
"Considers",
"all",
"accessed",
"fields",
"of",
"the",
"criteria",
"."
] | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Framework/DataAbstractionLayer/Cache/EntityCacheKeyGenerator.php#L97-L108 |
shopware/platform | src/Core/Framework/DataAbstractionLayer/Cache/EntityCacheKeyGenerator.php | EntityCacheKeyGenerator.getAggregationTags | public function getAggregationTags(EntityDefinition $definition, Criteria $criteria, Aggregation $aggregation): array
{
$tags = [$definition->getEntityName() . '.id'];
$fields = $criteria->getAggregationQueryFields();
$fields = array_merge($fields, $aggregation->getFields());
forea... | php | public function getAggregationTags(EntityDefinition $definition, Criteria $criteria, Aggregation $aggregation): array
{
$tags = [$definition->getEntityName() . '.id'];
$fields = $criteria->getAggregationQueryFields();
$fields = array_merge($fields, $aggregation->getFields());
forea... | [
"public",
"function",
"getAggregationTags",
"(",
"EntityDefinition",
"$",
"definition",
",",
"Criteria",
"$",
"criteria",
",",
"Aggregation",
"$",
"aggregation",
")",
":",
"array",
"{",
"$",
"tags",
"=",
"[",
"$",
"definition",
"->",
"getEntityName",
"(",
")",... | Calculates all cache tags for the provided aggregation. Considers the criteria filters and queries. | [
"Calculates",
"all",
"cache",
"tags",
"for",
"the",
"provided",
"aggregation",
".",
"Considers",
"the",
"criteria",
"filters",
"and",
"queries",
"."
] | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Framework/DataAbstractionLayer/Cache/EntityCacheKeyGenerator.php#L113-L127 |
shopware/platform | src/Core/Framework/DataAbstractionLayer/Cache/EntityCacheKeyGenerator.php | EntityCacheKeyGenerator.getAssociatedTags | public function getAssociatedTags(EntityDefinition $definition, Entity $entity, Context $context): array
{
$associations = $definition->getFields()->filterInstance(AssociationField::class);
$keys = [$this->getEntityTag($entity->getUniqueIdentifier(), $definition)];
foreach ($context->getLa... | php | public function getAssociatedTags(EntityDefinition $definition, Entity $entity, Context $context): array
{
$associations = $definition->getFields()->filterInstance(AssociationField::class);
$keys = [$this->getEntityTag($entity->getUniqueIdentifier(), $definition)];
foreach ($context->getLa... | [
"public",
"function",
"getAssociatedTags",
"(",
"EntityDefinition",
"$",
"definition",
",",
"Entity",
"$",
"entity",
",",
"Context",
"$",
"context",
")",
":",
"array",
"{",
"$",
"associations",
"=",
"$",
"definition",
"->",
"getFields",
"(",
")",
"->",
"filt... | Calculates all tags for a single entity. Considers the language chain, context states and loaded associations | [
"Calculates",
"all",
"tags",
"for",
"a",
"single",
"entity",
".",
"Considers",
"the",
"language",
"chain",
"context",
"states",
"and",
"loaded",
"associations"
] | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Framework/DataAbstractionLayer/Cache/EntityCacheKeyGenerator.php#L132-L199 |
shopware/platform | src/Core/Framework/DataAbstractionLayer/Dbal/EntityForeignKeyResolver.php | EntityForeignKeyResolver.getAffectedDeleteRestrictions | public function getAffectedDeleteRestrictions(EntityDefinition $definition, array $ids, Context $context): array
{
return $this->fetch($definition, $ids, RestrictDelete::class, $context);
} | php | public function getAffectedDeleteRestrictions(EntityDefinition $definition, array $ids, Context $context): array
{
return $this->fetch($definition, $ids, RestrictDelete::class, $context);
} | [
"public",
"function",
"getAffectedDeleteRestrictions",
"(",
"EntityDefinition",
"$",
"definition",
",",
"array",
"$",
"ids",
",",
"Context",
"$",
"context",
")",
":",
"array",
"{",
"return",
"$",
"this",
"->",
"fetch",
"(",
"$",
"definition",
",",
"$",
"ids"... | Returns an associated nested array which contains all affected restrictions of the provided ids.
Example:
[
[
'pk' => '43c6baad756140d8aabbbca533a8284f'
restrictions => [
'Shopware\Core\Content\Product\ProductDefinition' => [
'1ffd7ea958c643558256927aae8efb07',
'1ffd7ea958c643558256927aae8efb07'
]
]
]
]
@throws \Runt... | [
"Returns",
"an",
"associated",
"nested",
"array",
"which",
"contains",
"all",
"affected",
"restrictions",
"of",
"the",
"provided",
"ids",
".",
"Example",
":",
"[",
"[",
"pk",
"=",
">",
"43c6baad756140d8aabbbca533a8284f",
"restrictions",
"=",
">",
"[",
"Shopware"... | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Framework/DataAbstractionLayer/Dbal/EntityForeignKeyResolver.php#L63-L66 |
shopware/platform | src/Core/Framework/DataAbstractionLayer/Dbal/EntityForeignKeyResolver.php | EntityForeignKeyResolver.getAffectedDeletes | public function getAffectedDeletes(EntityDefinition $definition, array $ids, Context $context): array
{
return $this->fetch($definition, $ids, CascadeDelete::class, $context);
} | php | public function getAffectedDeletes(EntityDefinition $definition, array $ids, Context $context): array
{
return $this->fetch($definition, $ids, CascadeDelete::class, $context);
} | [
"public",
"function",
"getAffectedDeletes",
"(",
"EntityDefinition",
"$",
"definition",
",",
"array",
"$",
"ids",
",",
"Context",
"$",
"context",
")",
":",
"array",
"{",
"return",
"$",
"this",
"->",
"fetch",
"(",
"$",
"definition",
",",
"$",
"ids",
",",
... | Returns an associated nested array which contains all affected cascaded delete entities.
Example:
[
[
'pk' => '43c6baad756140d8aabbbca533a8284f'
restrictions => [
'Shopware\Core\Content\Product\ProductDefinition' => [
'1ffd7ea958c643558256927aae8efb07',
'1ffd7ea958c643558256927aae8efb07'
]
]
]
]
@throws \RuntimeExcep... | [
"Returns",
"an",
"associated",
"nested",
"array",
"which",
"contains",
"all",
"affected",
"cascaded",
"delete",
"entities",
".",
"Example",
":",
"[",
"[",
"pk",
"=",
">",
"43c6baad756140d8aabbbca533a8284f",
"restrictions",
"=",
">",
"[",
"Shopware",
"\\",
"Core"... | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Framework/DataAbstractionLayer/Dbal/EntityForeignKeyResolver.php#L86-L89 |
shopware/platform | src/Core/Checkout/Cart/LineItem/LineItemCollection.php | LineItemCollection.add | public function add($lineItem): void
{
$this->validateType($lineItem);
$exists = $this->get($lineItem->getKey());
if ($exists && $exists->getType() !== $lineItem->getType()) {
throw new MixedLineItemTypeException($lineItem->getKey(), $exists->getType());
}
if (... | php | public function add($lineItem): void
{
$this->validateType($lineItem);
$exists = $this->get($lineItem->getKey());
if ($exists && $exists->getType() !== $lineItem->getType()) {
throw new MixedLineItemTypeException($lineItem->getKey(), $exists->getType());
}
if (... | [
"public",
"function",
"add",
"(",
"$",
"lineItem",
")",
":",
"void",
"{",
"$",
"this",
"->",
"validateType",
"(",
"$",
"lineItem",
")",
";",
"$",
"exists",
"=",
"$",
"this",
"->",
"get",
"(",
"$",
"lineItem",
"->",
"getKey",
"(",
")",
")",
";",
"... | @param LineItem $lineItem
@throws MixedLineItemTypeException
@throws InvalidQuantityException
@throws LineItemNotStackableException | [
"@param",
"LineItem",
"$lineItem"
] | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Checkout/Cart/LineItem/LineItemCollection.php#L27-L44 |
shopware/platform | src/Core/Checkout/Promotion/Validator/PromotionValidator.php | PromotionValidator.preValidate | public function preValidate(array $writeCommands, WriteContext $context): void
{
$violationList = new ConstraintViolationList();
/** @var WriteCommandInterface $command */
foreach ($writeCommands as $command) {
if (!$command instanceof InsertCommand && !$command instanceof Updat... | php | public function preValidate(array $writeCommands, WriteContext $context): void
{
$violationList = new ConstraintViolationList();
/** @var WriteCommandInterface $command */
foreach ($writeCommands as $command) {
if (!$command instanceof InsertCommand && !$command instanceof Updat... | [
"public",
"function",
"preValidate",
"(",
"array",
"$",
"writeCommands",
",",
"WriteContext",
"$",
"context",
")",
":",
"void",
"{",
"$",
"violationList",
"=",
"new",
"ConstraintViolationList",
"(",
")",
";",
"/** @var WriteCommandInterface $command */",
"foreach",
... | This function validates our incoming delta-values for promotions
and its aggregation. It does only check for business relevant rules and logic.
All primitive "required" constraints are done inside the definition of the entity.
@param array $writeCommands all incoming commands
@param WriteContext $context ... | [
"This",
"function",
"validates",
"our",
"incoming",
"delta",
"-",
"values",
"for",
"promotions",
"and",
"its",
"aggregation",
".",
"It",
"does",
"only",
"check",
"for",
"business",
"relevant",
"rules",
"and",
"logic",
".",
"All",
"primitive",
"required",
"cons... | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Checkout/Promotion/Validator/PromotionValidator.php#L43-L67 |
shopware/platform | src/Core/Checkout/Promotion/Validator/PromotionValidator.php | PromotionValidator.validatePromotion | private function validatePromotion(array $payload, ConstraintViolationList $violationList)
{
/** @var bool|null $useCodes */
$useCodes = $this->getValue($payload, 'use_codes', null);
/** @var string $code */
$code = $this->getValue($payload, 'code', null);
$validFrom = $thi... | php | private function validatePromotion(array $payload, ConstraintViolationList $violationList)
{
/** @var bool|null $useCodes */
$useCodes = $this->getValue($payload, 'use_codes', null);
/** @var string $code */
$code = $this->getValue($payload, 'code', null);
$validFrom = $thi... | [
"private",
"function",
"validatePromotion",
"(",
"array",
"$",
"payload",
",",
"ConstraintViolationList",
"$",
"violationList",
")",
"{",
"/** @var bool|null $useCodes */",
"$",
"useCodes",
"=",
"$",
"this",
"->",
"getValue",
"(",
"$",
"payload",
",",
"'use_codes'",... | Validates the provided Promotion data and adds
violations to the provided list of violations, if found.
@param array $payload the incoming delta-data
@param ConstraintViolationList $violationList the list of violations that needs to be filled
@throws \Exception | [
"Validates",
"the",
"provided",
"Promotion",
"data",
"and",
"adds",
"violations",
"to",
"the",
"provided",
"list",
"of",
"violations",
"if",
"found",
"."
] | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Checkout/Promotion/Validator/PromotionValidator.php#L90-L126 |
shopware/platform | src/Core/Checkout/Promotion/Validator/PromotionValidator.php | PromotionValidator.validateDiscount | private function validateDiscount(array $payload, ConstraintViolationList $violationList)
{
/** @var string $type */
$type = $this->getValue($payload, 'type', '');
/** @var float|null $value */
$value = $this->getValue($payload, 'value', null);
if ($value === null) {
... | php | private function validateDiscount(array $payload, ConstraintViolationList $violationList)
{
/** @var string $type */
$type = $this->getValue($payload, 'type', '');
/** @var float|null $value */
$value = $this->getValue($payload, 'value', null);
if ($value === null) {
... | [
"private",
"function",
"validateDiscount",
"(",
"array",
"$",
"payload",
",",
"ConstraintViolationList",
"$",
"violationList",
")",
"{",
"/** @var string $type */",
"$",
"type",
"=",
"$",
"this",
"->",
"getValue",
"(",
"$",
"payload",
",",
"'type'",
",",
"''",
... | Validates the provided PromotionDiscount data and adds
violations to the provided list of violations, if found.
@param array $payload the incoming delta-data
@param ConstraintViolationList $violationList the list of violations that needs to be filled | [
"Validates",
"the",
"provided",
"PromotionDiscount",
"data",
"and",
"adds",
"violations",
"to",
"the",
"provided",
"list",
"of",
"violations",
"if",
"found",
"."
] | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Checkout/Promotion/Validator/PromotionValidator.php#L135-L158 |
shopware/platform | src/Core/Checkout/Promotion/Validator/PromotionValidator.php | PromotionValidator.buildViolation | private function buildViolation(string $message, $invalidValue): ConstraintViolationInterface
{
return new ConstraintViolation(
$message,
'',
[
'value' => $invalidValue,
],
$invalidValue,
null,
$invalidValue
... | php | private function buildViolation(string $message, $invalidValue): ConstraintViolationInterface
{
return new ConstraintViolation(
$message,
'',
[
'value' => $invalidValue,
],
$invalidValue,
null,
$invalidValue
... | [
"private",
"function",
"buildViolation",
"(",
"string",
"$",
"message",
",",
"$",
"invalidValue",
")",
":",
"ConstraintViolationInterface",
"{",
"return",
"new",
"ConstraintViolation",
"(",
"$",
"message",
",",
"''",
",",
"[",
"'value'",
"=>",
"$",
"invalidValue... | This helper function builds an easy violation
object for our validator.
@param string $message the error message
@param string|float|null $invalidValue the actual invalid value
@return ConstraintViolationInterface the built constraint violation | [
"This",
"helper",
"function",
"builds",
"an",
"easy",
"violation",
"object",
"for",
"our",
"validator",
"."
] | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Checkout/Promotion/Validator/PromotionValidator.php#L188-L200 |
shopware/platform | src/Core/Framework/Validation/CommandQueueValidator.php | CommandQueueValidator.preValidate | public function preValidate(array $writeCommands, WriteContext $context): void
{
$exceptionStack = new FieldExceptionStack();
foreach ($this->validators as $validators) {
try {
$validators->preValidate($writeCommands, $context);
} catch (WriteConstraintViolat... | php | public function preValidate(array $writeCommands, WriteContext $context): void
{
$exceptionStack = new FieldExceptionStack();
foreach ($this->validators as $validators) {
try {
$validators->preValidate($writeCommands, $context);
} catch (WriteConstraintViolat... | [
"public",
"function",
"preValidate",
"(",
"array",
"$",
"writeCommands",
",",
"WriteContext",
"$",
"context",
")",
":",
"void",
"{",
"$",
"exceptionStack",
"=",
"new",
"FieldExceptionStack",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"validators",
"as... | @param WriteCommandInterface[] $writeCommands
@throws WriteStackException | [
"@param",
"WriteCommandInterface",
"[]",
"$writeCommands"
] | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Framework/Validation/CommandQueueValidator.php#L58-L71 |
shopware/platform | src/Core/Framework/DataAbstractionLayer/FieldSerializer/JsonFieldSerializer.php | JsonFieldSerializer.encodeJson | public static function encodeJson($value, int $options = JSON_UNESCAPED_UNICODE | JSON_PRESERVE_ZERO_FRACTION): string
{
return \json_encode($value, $options);
} | php | public static function encodeJson($value, int $options = JSON_UNESCAPED_UNICODE | JSON_PRESERVE_ZERO_FRACTION): string
{
return \json_encode($value, $options);
} | [
"public",
"static",
"function",
"encodeJson",
"(",
"$",
"value",
",",
"int",
"$",
"options",
"=",
"JSON_UNESCAPED_UNICODE",
"|",
"JSON_PRESERVE_ZERO_FRACTION",
")",
":",
"string",
"{",
"return",
"\\",
"json_encode",
"(",
"$",
"value",
",",
"$",
"options",
")",... | mariadbs `JSON_VALID` function does not allow escaped unicode. | [
"mariadbs",
"JSON_VALID",
"function",
"does",
"not",
"allow",
"escaped",
"unicode",
"."
] | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Framework/DataAbstractionLayer/FieldSerializer/JsonFieldSerializer.php#L54-L57 |
shopware/platform | src/Core/System/SystemConfig/Api/SystemConfigController.php | SystemConfigController.getConfiguration | public function getConfiguration(Request $request): JsonResponse
{
$domain = $request->query->get('domain');
if (!$domain) {
throw new MissingRequestParameterException('domain');
}
return new JsonResponse($this->configurationService->getConfiguration($domain));
} | php | public function getConfiguration(Request $request): JsonResponse
{
$domain = $request->query->get('domain');
if (!$domain) {
throw new MissingRequestParameterException('domain');
}
return new JsonResponse($this->configurationService->getConfiguration($domain));
} | [
"public",
"function",
"getConfiguration",
"(",
"Request",
"$",
"request",
")",
":",
"JsonResponse",
"{",
"$",
"domain",
"=",
"$",
"request",
"->",
"query",
"->",
"get",
"(",
"'domain'",
")",
";",
"if",
"(",
"!",
"$",
"domain",
")",
"{",
"throw",
"new",... | @Route("/api/v{version}/_action/system-config/schema", name="api.action.core.system-config", methods={"GET"})
@throws MissingRequestParameterException | [
"@Route",
"(",
"/",
"api",
"/",
"v",
"{",
"version",
"}",
"/",
"_action",
"/",
"system",
"-",
"config",
"/",
"schema",
"name",
"=",
"api",
".",
"action",
".",
"core",
".",
"system",
"-",
"config",
"methods",
"=",
"{",
"GET",
"}",
")"
] | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/System/SystemConfig/Api/SystemConfigController.php#L51-L60 |
shopware/platform | src/Core/Checkout/Customer/SalesChannel/SalesChannelCustomerController.php | SalesChannelCustomerController.orderList | public function orderList(Request $request, SalesChannelContext $context): JsonResponse
{
$limit = $request->query->getInt('limit', 10);
$page = $request->query->getInt('page', 1);
return new JsonResponse($this->serialize($this->loadOrders($page, $limit, $context)));
} | php | public function orderList(Request $request, SalesChannelContext $context): JsonResponse
{
$limit = $request->query->getInt('limit', 10);
$page = $request->query->getInt('page', 1);
return new JsonResponse($this->serialize($this->loadOrders($page, $limit, $context)));
} | [
"public",
"function",
"orderList",
"(",
"Request",
"$",
"request",
",",
"SalesChannelContext",
"$",
"context",
")",
":",
"JsonResponse",
"{",
"$",
"limit",
"=",
"$",
"request",
"->",
"query",
"->",
"getInt",
"(",
"'limit'",
",",
"10",
")",
";",
"$",
"pag... | @Route("/sales-channel-api/v{version}/customer/order", name="sales-channel-api.customer.order.list", methods={"GET"})
@throws CustomerNotLoggedInException | [
"@Route",
"(",
"/",
"sales",
"-",
"channel",
"-",
"api",
"/",
"v",
"{",
"version",
"}",
"/",
"customer",
"/",
"order",
"name",
"=",
"sales",
"-",
"channel",
"-",
"api",
".",
"customer",
".",
"order",
".",
"list",
"methods",
"=",
"{",
"GET",
"}",
... | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Checkout/Customer/SalesChannel/SalesChannelCustomerController.php#L108-L114 |
shopware/platform | src/Core/Checkout/Customer/SalesChannel/SalesChannelCustomerController.php | SalesChannelCustomerController.getCustomerDetail | public function getCustomerDetail(Request $request, SalesChannelContext $context, ResponseFactoryInterface $responseFactory): Response
{
return $responseFactory->createDetailResponse(
$this->accountService->getCustomerByContext($context),
$this->customerDefinition,
$reque... | php | public function getCustomerDetail(Request $request, SalesChannelContext $context, ResponseFactoryInterface $responseFactory): Response
{
return $responseFactory->createDetailResponse(
$this->accountService->getCustomerByContext($context),
$this->customerDefinition,
$reque... | [
"public",
"function",
"getCustomerDetail",
"(",
"Request",
"$",
"request",
",",
"SalesChannelContext",
"$",
"context",
",",
"ResponseFactoryInterface",
"$",
"responseFactory",
")",
":",
"Response",
"{",
"return",
"$",
"responseFactory",
"->",
"createDetailResponse",
"... | @Route("/sales-channel-api/v{version}/customer", name="sales-channel-api.customer.detail", methods={"GET"})
@throws CustomerNotLoggedInException | [
"@Route",
"(",
"/",
"sales",
"-",
"channel",
"-",
"api",
"/",
"v",
"{",
"version",
"}",
"/",
"customer",
"name",
"=",
"sales",
"-",
"channel",
"-",
"api",
".",
"customer",
".",
"detail",
"methods",
"=",
"{",
"GET",
"}",
")"
] | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Checkout/Customer/SalesChannel/SalesChannelCustomerController.php#L180-L188 |
shopware/platform | src/Core/Checkout/Customer/SalesChannel/SalesChannelCustomerController.php | SalesChannelCustomerController.getAddresses | public function getAddresses(SalesChannelContext $context): JsonResponse
{
return new JsonResponse(
$this->serialize($this->addressService->getAddressByContext($context))
);
} | php | public function getAddresses(SalesChannelContext $context): JsonResponse
{
return new JsonResponse(
$this->serialize($this->addressService->getAddressByContext($context))
);
} | [
"public",
"function",
"getAddresses",
"(",
"SalesChannelContext",
"$",
"context",
")",
":",
"JsonResponse",
"{",
"return",
"new",
"JsonResponse",
"(",
"$",
"this",
"->",
"serialize",
"(",
"$",
"this",
"->",
"addressService",
"->",
"getAddressByContext",
"(",
"$"... | @Route("/sales-channel-api/v{version}/customer/address", name="sales-channel-api.customer.address.list", methods={"GET"})
@throws CustomerNotLoggedInException | [
"@Route",
"(",
"/",
"sales",
"-",
"channel",
"-",
"api",
"/",
"v",
"{",
"version",
"}",
"/",
"customer",
"/",
"address",
"name",
"=",
"sales",
"-",
"channel",
"-",
"api",
".",
"customer",
".",
"address",
".",
"list",
"methods",
"=",
"{",
"GET",
"}"... | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Checkout/Customer/SalesChannel/SalesChannelCustomerController.php#L195-L200 |
shopware/platform | src/Core/Checkout/Customer/SalesChannel/SalesChannelCustomerController.php | SalesChannelCustomerController.getAddress | public function getAddress(string $id, SalesChannelContext $context): JsonResponse
{
return new JsonResponse(
$this->serialize($this->addressService->getById($id, $context))
);
} | php | public function getAddress(string $id, SalesChannelContext $context): JsonResponse
{
return new JsonResponse(
$this->serialize($this->addressService->getById($id, $context))
);
} | [
"public",
"function",
"getAddress",
"(",
"string",
"$",
"id",
",",
"SalesChannelContext",
"$",
"context",
")",
":",
"JsonResponse",
"{",
"return",
"new",
"JsonResponse",
"(",
"$",
"this",
"->",
"serialize",
"(",
"$",
"this",
"->",
"addressService",
"->",
"ge... | @Route("/sales-channel-api/v{version}/customer/address/{id}", name="sales-channel-api.customer.address.detail", methods={"GET"})
@throws AddressNotFoundException
@throws CustomerNotLoggedInException
@throws InvalidUuidException | [
"@Route",
"(",
"/",
"sales",
"-",
"channel",
"-",
"api",
"/",
"v",
"{",
"version",
"}",
"/",
"customer",
"/",
"address",
"/",
"{",
"id",
"}",
"name",
"=",
"sales",
"-",
"channel",
"-",
"api",
".",
"customer",
".",
"address",
".",
"detail",
"methods... | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Checkout/Customer/SalesChannel/SalesChannelCustomerController.php#L209-L214 |
shopware/platform | src/Core/Checkout/Customer/SalesChannel/SalesChannelCustomerController.php | SalesChannelCustomerController.createAddress | public function createAddress(RequestDataBag $requestData, SalesChannelContext $context): JsonResponse
{
$addressId = $this->addressService->create($requestData, $context);
$this->salesChannelContextService->refresh(
$context->getSalesChannel()->getId(),
$context->getToken()... | php | public function createAddress(RequestDataBag $requestData, SalesChannelContext $context): JsonResponse
{
$addressId = $this->addressService->create($requestData, $context);
$this->salesChannelContextService->refresh(
$context->getSalesChannel()->getId(),
$context->getToken()... | [
"public",
"function",
"createAddress",
"(",
"RequestDataBag",
"$",
"requestData",
",",
"SalesChannelContext",
"$",
"context",
")",
":",
"JsonResponse",
"{",
"$",
"addressId",
"=",
"$",
"this",
"->",
"addressService",
"->",
"create",
"(",
"$",
"requestData",
",",... | @Route("/sales-channel-api/v{version}/customer/address", name="sales-channel-api.customer.address.create", methods={"POST"})
@throws AddressNotFoundException
@throws CustomerNotLoggedInException
@throws InvalidUuidException | [
"@Route",
"(",
"/",
"sales",
"-",
"channel",
"-",
"api",
"/",
"v",
"{",
"version",
"}",
"/",
"customer",
"/",
"address",
"name",
"=",
"sales",
"-",
"channel",
"-",
"api",
".",
"customer",
".",
"address",
".",
"create",
"methods",
"=",
"{",
"POST",
... | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Checkout/Customer/SalesChannel/SalesChannelCustomerController.php#L223-L234 |
shopware/platform | src/Core/Checkout/Customer/SalesChannel/SalesChannelCustomerController.php | SalesChannelCustomerController.deleteAddress | public function deleteAddress(string $id, SalesChannelContext $context): JsonResponse
{
$this->addressService->delete($id, $context);
return new JsonResponse($this->serialize($id));
} | php | public function deleteAddress(string $id, SalesChannelContext $context): JsonResponse
{
$this->addressService->delete($id, $context);
return new JsonResponse($this->serialize($id));
} | [
"public",
"function",
"deleteAddress",
"(",
"string",
"$",
"id",
",",
"SalesChannelContext",
"$",
"context",
")",
":",
"JsonResponse",
"{",
"$",
"this",
"->",
"addressService",
"->",
"delete",
"(",
"$",
"id",
",",
"$",
"context",
")",
";",
"return",
"new",... | @Route("/sales-channel-api/v{version}/customer/address/{id}", name="sales-channel-api.customer.address.delete", methods={"DELETE"})
@throws AddressNotFoundException
@throws CustomerNotLoggedInException
@throws InvalidUuidException | [
"@Route",
"(",
"/",
"sales",
"-",
"channel",
"-",
"api",
"/",
"v",
"{",
"version",
"}",
"/",
"customer",
"/",
"address",
"/",
"{",
"id",
"}",
"name",
"=",
"sales",
"-",
"channel",
"-",
"api",
".",
"customer",
".",
"address",
".",
"delete",
"methods... | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Checkout/Customer/SalesChannel/SalesChannelCustomerController.php#L243-L248 |
shopware/platform | src/Core/Checkout/Customer/SalesChannel/SalesChannelCustomerController.php | SalesChannelCustomerController.setDefaultShippingAddress | public function setDefaultShippingAddress(string $id, SalesChannelContext $context): JsonResponse
{
if (!Uuid::isValid($id)) {
throw new InvalidUuidException($id);
}
$this->accountService->setDefaultShippingAddress($id, $context);
return new JsonResponse($this->serialize... | php | public function setDefaultShippingAddress(string $id, SalesChannelContext $context): JsonResponse
{
if (!Uuid::isValid($id)) {
throw new InvalidUuidException($id);
}
$this->accountService->setDefaultShippingAddress($id, $context);
return new JsonResponse($this->serialize... | [
"public",
"function",
"setDefaultShippingAddress",
"(",
"string",
"$",
"id",
",",
"SalesChannelContext",
"$",
"context",
")",
":",
"JsonResponse",
"{",
"if",
"(",
"!",
"Uuid",
"::",
"isValid",
"(",
"$",
"id",
")",
")",
"{",
"throw",
"new",
"InvalidUuidExcept... | @Route("/sales-channel-api/v{version}/customer/address/{id}/default-shipping", name="sales-channel-api.customer.address.set-default-shipping-address", methods={"PATCH"})
@throws CustomerNotLoggedInException
@throws InvalidUuidException
@throws AddressNotFoundException | [
"@Route",
"(",
"/",
"sales",
"-",
"channel",
"-",
"api",
"/",
"v",
"{",
"version",
"}",
"/",
"customer",
"/",
"address",
"/",
"{",
"id",
"}",
"/",
"default",
"-",
"shipping",
"name",
"=",
"sales",
"-",
"channel",
"-",
"api",
".",
"customer",
".",
... | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Checkout/Customer/SalesChannel/SalesChannelCustomerController.php#L257-L265 |
shopware/platform | src/Core/Checkout/Customer/SalesChannel/SalesChannelCustomerController.php | SalesChannelCustomerController.setDefaultBillingAddress | public function setDefaultBillingAddress(string $id, SalesChannelContext $context): JsonResponse
{
$this->accountService->setDefaultBillingAddress($id, $context);
return new JsonResponse($this->serialize($id));
} | php | public function setDefaultBillingAddress(string $id, SalesChannelContext $context): JsonResponse
{
$this->accountService->setDefaultBillingAddress($id, $context);
return new JsonResponse($this->serialize($id));
} | [
"public",
"function",
"setDefaultBillingAddress",
"(",
"string",
"$",
"id",
",",
"SalesChannelContext",
"$",
"context",
")",
":",
"JsonResponse",
"{",
"$",
"this",
"->",
"accountService",
"->",
"setDefaultBillingAddress",
"(",
"$",
"id",
",",
"$",
"context",
")"... | @Route("/sales-channel-api/v{version}/customer/address/{id}/default-billing", name="sales-channel-api.customer.address.set-default-billing-address", methods={"PATCH"})
@throws AddressNotFoundException
@throws CustomerNotLoggedInException
@throws InvalidUuidException | [
"@Route",
"(",
"/",
"sales",
"-",
"channel",
"-",
"api",
"/",
"v",
"{",
"version",
"}",
"/",
"customer",
"/",
"address",
"/",
"{",
"id",
"}",
"/",
"default",
"-",
"billing",
"name",
"=",
"sales",
"-",
"channel",
"-",
"api",
".",
"customer",
".",
... | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Checkout/Customer/SalesChannel/SalesChannelCustomerController.php#L274-L279 |
shopware/platform | src/Core/Content/MailTemplate/Api/MailActionController.php | MailActionController.validate | public function validate(RequestDataBag $post): JsonResponse
{
$this->templateRenderer->render($post->get('contentHtml', ''), []);
$this->templateRenderer->render($post->get('contentPlain', ''), []);
return new JsonResponse(null, Response::HTTP_NO_CONTENT);
} | php | public function validate(RequestDataBag $post): JsonResponse
{
$this->templateRenderer->render($post->get('contentHtml', ''), []);
$this->templateRenderer->render($post->get('contentPlain', ''), []);
return new JsonResponse(null, Response::HTTP_NO_CONTENT);
} | [
"public",
"function",
"validate",
"(",
"RequestDataBag",
"$",
"post",
")",
":",
"JsonResponse",
"{",
"$",
"this",
"->",
"templateRenderer",
"->",
"render",
"(",
"$",
"post",
"->",
"get",
"(",
"'contentHtml'",
",",
"''",
")",
",",
"[",
"]",
")",
";",
"$... | Validates if an email template can be rendered without sending an email
@Route("/api/v{version}/_action/mail-template/validate", name="api.action.mail_template.validate", methods={"POST"})
@throws StringTemplateRenderingException | [
"Validates",
"if",
"an",
"email",
"template",
"can",
"be",
"rendered",
"without",
"sending",
"an",
"email"
] | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Content/MailTemplate/Api/MailActionController.php#L52-L58 |
shopware/platform | src/Core/Framework/Util/XmlReader.php | XmlReader.read | public function read(string $xmlFile): array
{
try {
$dom = XmlUtils::loadFile($xmlFile, $this->xsdFile);
} catch (\Exception $e) {
throw new XmlParsingException($xmlFile, $e->getMessage());
}
return $this->parseFile($dom);
} | php | public function read(string $xmlFile): array
{
try {
$dom = XmlUtils::loadFile($xmlFile, $this->xsdFile);
} catch (\Exception $e) {
throw new XmlParsingException($xmlFile, $e->getMessage());
}
return $this->parseFile($dom);
} | [
"public",
"function",
"read",
"(",
"string",
"$",
"xmlFile",
")",
":",
"array",
"{",
"try",
"{",
"$",
"dom",
"=",
"XmlUtils",
"::",
"loadFile",
"(",
"$",
"xmlFile",
",",
"$",
"this",
"->",
"xsdFile",
")",
";",
"}",
"catch",
"(",
"\\",
"Exception",
... | load and validate xml file - parse to array
@throws XmlParsingException | [
"load",
"and",
"validate",
"xml",
"file",
"-",
"parse",
"to",
"array"
] | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Framework/Util/XmlReader.php#L21-L30 |
shopware/platform | src/Core/Framework/Plugin/Command/PluginRefreshCommand.php | PluginRefreshCommand.execute | protected function execute(InputInterface $input, OutputInterface $output)
{
$io = new SymfonyStyle($input, $output);
$io->title('Shopware Plugin Service');
$context = Context::createDefaultContext();
$errors = $this->pluginService->refreshPlugins($context, new ConsoleIO($input, $out... | php | protected function execute(InputInterface $input, OutputInterface $output)
{
$io = new SymfonyStyle($input, $output);
$io->title('Shopware Plugin Service');
$context = Context::createDefaultContext();
$errors = $this->pluginService->refreshPlugins($context, new ConsoleIO($input, $out... | [
"protected",
"function",
"execute",
"(",
"InputInterface",
"$",
"input",
",",
"OutputInterface",
"$",
"output",
")",
"{",
"$",
"io",
"=",
"new",
"SymfonyStyle",
"(",
"$",
"input",
",",
"$",
"output",
")",
";",
"$",
"io",
"->",
"title",
"(",
"'Shopware Pl... | {@inheritdoc} | [
"{"
] | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Framework/Plugin/Command/PluginRefreshCommand.php#L44-L69 |
shopware/platform | src/Core/Framework/DataAbstractionLayer/SchemaIndexListener.php | SchemaIndexListener.onSchemaIndexDefinition | public function onSchemaIndexDefinition(SchemaIndexDefinitionEventArgs $event): void
{
$event->preventDefault();
$data = $event->getTableIndex();
$name = str_replace('.', '__', $data['name']);
$event->setIndex(new Index($name, $data['columns'], $data['unique'], $data['primary'], $da... | php | public function onSchemaIndexDefinition(SchemaIndexDefinitionEventArgs $event): void
{
$event->preventDefault();
$data = $event->getTableIndex();
$name = str_replace('.', '__', $data['name']);
$event->setIndex(new Index($name, $data['columns'], $data['unique'], $data['primary'], $da... | [
"public",
"function",
"onSchemaIndexDefinition",
"(",
"SchemaIndexDefinitionEventArgs",
"$",
"event",
")",
":",
"void",
"{",
"$",
"event",
"->",
"preventDefault",
"(",
")",
";",
"$",
"data",
"=",
"$",
"event",
"->",
"getTableIndex",
"(",
")",
";",
"$",
"name... | Doctrine has its own format for foreign keys. fk.test.column will be split into:
namespace: fk; name: test; everything after the second dot is not considered. this causes collition with our
fk naming | [
"Doctrine",
"has",
"its",
"own",
"format",
"for",
"foreign",
"keys",
".",
"fk",
".",
"test",
".",
"column",
"will",
"be",
"split",
"into",
":",
"namespace",
":",
"fk",
";",
"name",
":",
"test",
";",
"everything",
"after",
"the",
"second",
"dot",
"is",
... | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Framework/DataAbstractionLayer/SchemaIndexListener.php#L14-L21 |
shopware/platform | src/Core/Profiling/Doctrine/ConnectionProfiler.php | ConnectionProfiler.collect | public function collect(Request $request, Response $response, ?\Exception $exception = null)
{
if (!$this->logger || !$this->logger instanceof DebugStack) {
$this->data['queries'] = [];
return;
}
$queries = $this->sanitizeQueries($this->logger->queries);
$t... | php | public function collect(Request $request, Response $response, ?\Exception $exception = null)
{
if (!$this->logger || !$this->logger instanceof DebugStack) {
$this->data['queries'] = [];
return;
}
$queries = $this->sanitizeQueries($this->logger->queries);
$t... | [
"public",
"function",
"collect",
"(",
"Request",
"$",
"request",
",",
"Response",
"$",
"response",
",",
"?",
"\\",
"Exception",
"$",
"exception",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"logger",
"||",
"!",
"$",
"this",
"->",
"logge... | {@inheritdoc} | [
"{"
] | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Profiling/Doctrine/ConnectionProfiler.php#L40-L51 |
shopware/platform | src/Core/Framework/Plugin/Command/PluginListCommand.php | PluginListCommand.execute | protected function execute(InputInterface $input, OutputInterface $output)
{
$io = new SymfonyStyle($input, $output);
$io->title('Shopware Plugin Service');
$context = Context::createDefaultContext();
$criteria = new Criteria();
$filter = $input->getOption('filter');
... | php | protected function execute(InputInterface $input, OutputInterface $output)
{
$io = new SymfonyStyle($input, $output);
$io->title('Shopware Plugin Service');
$context = Context::createDefaultContext();
$criteria = new Criteria();
$filter = $input->getOption('filter');
... | [
"protected",
"function",
"execute",
"(",
"InputInterface",
"$",
"input",
",",
"OutputInterface",
"$",
"output",
")",
"{",
"$",
"io",
"=",
"new",
"SymfonyStyle",
"(",
"$",
"input",
",",
"$",
"output",
")",
";",
"$",
"io",
"->",
"title",
"(",
"'Shopware Pl... | {@inheritdoc} | [
"{"
] | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Framework/Plugin/Command/PluginListCommand.php#L44-L112 |
shopware/platform | src/Core/Checkout/Promotion/Cart/CartPromotionsCollector.php | CartPromotionsCollector.prepare | public function prepare(StructCollection $definitions, Cart $cart, SalesChannelContext $context, CartBehavior $behavior): void
{
$placeholderItemIds = [];
/** @var array $promotionLineItems */
$promotionLineItems = $this->getPromotionLineItems($cart);
// We must not touch any exist... | php | public function prepare(StructCollection $definitions, Cart $cart, SalesChannelContext $context, CartBehavior $behavior): void
{
$placeholderItemIds = [];
/** @var array $promotionLineItems */
$promotionLineItems = $this->getPromotionLineItems($cart);
// We must not touch any exist... | [
"public",
"function",
"prepare",
"(",
"StructCollection",
"$",
"definitions",
",",
"Cart",
"$",
"cart",
",",
"SalesChannelContext",
"$",
"context",
",",
"CartBehavior",
"$",
"behavior",
")",
":",
"void",
"{",
"$",
"placeholderItemIds",
"=",
"[",
"]",
";",
"/... | This function extracts all place holder promotion items from
the cart and makes sure they get converted into real promotion line items later.
Only these codes along with all automatic non-code promotions will be
loaded later when collecting the eligible promotions. | [
"This",
"function",
"extracts",
"all",
"place",
"holder",
"promotion",
"items",
"from",
"the",
"cart",
"and",
"makes",
"sure",
"they",
"get",
"converted",
"into",
"real",
"promotion",
"line",
"items",
"later",
".",
"Only",
"these",
"codes",
"along",
"with",
... | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Checkout/Promotion/Cart/CartPromotionsCollector.php#L57-L74 |
shopware/platform | src/Core/Checkout/Promotion/Cart/CartPromotionsCollector.php | CartPromotionsCollector.collect | public function collect(StructCollection $fetchDefinitions, StructCollection $data, Cart $cart, SalesChannelContext $context, CartBehavior $behavior): void
{
/** @var Collection $promotionDefinitions */
$promotionDefinitions = $fetchDefinitions->filterInstance(CartPromotionsFetchDefinition::class);
... | php | public function collect(StructCollection $fetchDefinitions, StructCollection $data, Cart $cart, SalesChannelContext $context, CartBehavior $behavior): void
{
/** @var Collection $promotionDefinitions */
$promotionDefinitions = $fetchDefinitions->filterInstance(CartPromotionsFetchDefinition::class);
... | [
"public",
"function",
"collect",
"(",
"StructCollection",
"$",
"fetchDefinitions",
",",
"StructCollection",
"$",
"data",
",",
"Cart",
"$",
"cart",
",",
"SalesChannelContext",
"$",
"context",
",",
"CartBehavior",
"$",
"behavior",
")",
":",
"void",
"{",
"/** @var ... | This function is used to collect our promotion data for our cart.
It queries the database for all placeholder promotions and their codes
along with all non-code promotions that are applied automatically if conditions are met.
The eligible promotions will then be passed on to the enrichment function.
@throws InvalidPay... | [
"This",
"function",
"is",
"used",
"to",
"collect",
"our",
"promotion",
"data",
"for",
"our",
"cart",
".",
"It",
"queries",
"the",
"database",
"for",
"all",
"placeholder",
"promotions",
"and",
"their",
"codes",
"along",
"with",
"all",
"non",
"-",
"code",
"p... | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Checkout/Promotion/Cart/CartPromotionsCollector.php#L85-L126 |
shopware/platform | src/Core/Checkout/Promotion/Cart/CartPromotionsCollector.php | CartPromotionsCollector.enrich | public function enrich(StructCollection $data, Cart $cart, SalesChannelContext $context, CartBehavior $behavior): void
{
/** @var array $promotionLineItems */
$promotionLineItems = $this->getPromotionLineItems($cart);
// first thing is, to remove all promotion placeholder items.
// ... | php | public function enrich(StructCollection $data, Cart $cart, SalesChannelContext $context, CartBehavior $behavior): void
{
/** @var array $promotionLineItems */
$promotionLineItems = $this->getPromotionLineItems($cart);
// first thing is, to remove all promotion placeholder items.
// ... | [
"public",
"function",
"enrich",
"(",
"StructCollection",
"$",
"data",
",",
"Cart",
"$",
"cart",
",",
"SalesChannelContext",
"$",
"context",
",",
"CartBehavior",
"$",
"behavior",
")",
":",
"void",
"{",
"/** @var array $promotionLineItems */",
"$",
"promotionLineItems... | This function enriches the cart with custom data that has been collected in our previous function.
All collected promotions will now be converted into real Promotion Line Items.
Placeholder items will be removed accordingly.
If we are in "live checkout mode", then we also remove existing promotion line items,
that migh... | [
"This",
"function",
"enriches",
"the",
"cart",
"with",
"custom",
"data",
"that",
"has",
"been",
"collected",
"in",
"our",
"previous",
"function",
".",
"All",
"collected",
"promotions",
"will",
"now",
"be",
"converted",
"into",
"real",
"Promotion",
"Line",
"Ite... | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Checkout/Promotion/Cart/CartPromotionsCollector.php#L139-L189 |
shopware/platform | src/Core/Checkout/Promotion/Cart/CartPromotionsCollector.php | CartPromotionsCollector.getPromotionLineItems | private function getPromotionLineItems(Cart $cart): array
{
return array_filter(
$cart->getLineItems()->getElements(),
function (LineItem $lineItem) {
return $lineItem->getType() === self::LINE_ITEM_TYPE;
}
);
} | php | private function getPromotionLineItems(Cart $cart): array
{
return array_filter(
$cart->getLineItems()->getElements(),
function (LineItem $lineItem) {
return $lineItem->getType() === self::LINE_ITEM_TYPE;
}
);
} | [
"private",
"function",
"getPromotionLineItems",
"(",
"Cart",
"$",
"cart",
")",
":",
"array",
"{",
"return",
"array_filter",
"(",
"$",
"cart",
"->",
"getLineItems",
"(",
")",
"->",
"getElements",
"(",
")",
",",
"function",
"(",
"LineItem",
"$",
"lineItem",
... | Gets all promotion line items from the cart.
This includes placeholders and real, satisfied promotion line items. | [
"Gets",
"all",
"promotion",
"line",
"items",
"from",
"the",
"cart",
".",
"This",
"includes",
"placeholders",
"and",
"real",
"satisfied",
"promotion",
"line",
"items",
"."
] | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Checkout/Promotion/Cart/CartPromotionsCollector.php#L195-L203 |
shopware/platform | src/Core/Checkout/Promotion/Cart/CartPromotionsCollector.php | CartPromotionsCollector.isPromotionPlaceholder | private function isPromotionPlaceholder(LineItem $lineItem): bool
{
if ($lineItem->getType() !== self::LINE_ITEM_TYPE) {
return false;
}
return substr($lineItem->getKey(), 0, strlen(PromotionItemBuilder::PLACEHOLDER_PREFIX)) === PromotionItemBuilder::PLACEHOLDER_PREFIX;
} | php | private function isPromotionPlaceholder(LineItem $lineItem): bool
{
if ($lineItem->getType() !== self::LINE_ITEM_TYPE) {
return false;
}
return substr($lineItem->getKey(), 0, strlen(PromotionItemBuilder::PLACEHOLDER_PREFIX)) === PromotionItemBuilder::PLACEHOLDER_PREFIX;
} | [
"private",
"function",
"isPromotionPlaceholder",
"(",
"LineItem",
"$",
"lineItem",
")",
":",
"bool",
"{",
"if",
"(",
"$",
"lineItem",
"->",
"getType",
"(",
")",
"!==",
"self",
"::",
"LINE_ITEM_TYPE",
")",
"{",
"return",
"false",
";",
"}",
"return",
"substr... | Gets if the line item is a placeholder and not yet satisfied
promotion line item. This is done by verifying if the key
starts with our placeholder prefix | [
"Gets",
"if",
"the",
"line",
"item",
"is",
"a",
"placeholder",
"and",
"not",
"yet",
"satisfied",
"promotion",
"line",
"item",
".",
"This",
"is",
"done",
"by",
"verifying",
"if",
"the",
"key",
"starts",
"with",
"our",
"placeholder",
"prefix"
] | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Checkout/Promotion/Cart/CartPromotionsCollector.php#L210-L217 |
shopware/platform | src/Core/Checkout/Promotion/Cart/CartPromotionsCollector.php | CartPromotionsCollector.isRealPromotionItem | private function isRealPromotionItem(LineItem $lineItem): bool
{
if ($lineItem->getType() !== self::LINE_ITEM_TYPE) {
return false;
}
// its a correct line item type, so it can either be
// a placeholder or a real one.
return !$this->isPromotionPlaceholder($lineI... | php | private function isRealPromotionItem(LineItem $lineItem): bool
{
if ($lineItem->getType() !== self::LINE_ITEM_TYPE) {
return false;
}
// its a correct line item type, so it can either be
// a placeholder or a real one.
return !$this->isPromotionPlaceholder($lineI... | [
"private",
"function",
"isRealPromotionItem",
"(",
"LineItem",
"$",
"lineItem",
")",
":",
"bool",
"{",
"if",
"(",
"$",
"lineItem",
"->",
"getType",
"(",
")",
"!==",
"self",
"::",
"LINE_ITEM_TYPE",
")",
"{",
"return",
"false",
";",
"}",
"// its a correct line... | Gets if the line item is a real and satisfied promotion line item. | [
"Gets",
"if",
"the",
"line",
"item",
"is",
"a",
"real",
"and",
"satisfied",
"promotion",
"line",
"item",
"."
] | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Checkout/Promotion/Cart/CartPromotionsCollector.php#L222-L231 |
shopware/platform | src/Core/Checkout/Promotion/Cart/CartPromotionsCollector.php | CartPromotionsCollector.getCodesFromPlaceholdersIds | private function getCodesFromPlaceholdersIds(Cart $cart, array $lineItemIDs): array
{
$codes = [];
/** @var array $promotionLineItems */
$promotionLineItems = $this->getPromotionLineItems($cart);
/** @var LineItem $lineItem */
foreach ($promotionLineItems as $lineItem) {
... | php | private function getCodesFromPlaceholdersIds(Cart $cart, array $lineItemIDs): array
{
$codes = [];
/** @var array $promotionLineItems */
$promotionLineItems = $this->getPromotionLineItems($cart);
/** @var LineItem $lineItem */
foreach ($promotionLineItems as $lineItem) {
... | [
"private",
"function",
"getCodesFromPlaceholdersIds",
"(",
"Cart",
"$",
"cart",
",",
"array",
"$",
"lineItemIDs",
")",
":",
"array",
"{",
"$",
"codes",
"=",
"[",
"]",
";",
"/** @var array $promotionLineItems */",
"$",
"promotionLineItems",
"=",
"$",
"this",
"->"... | This function extracts all code strings from the
placeholder items of the provided Ids within the cart. | [
"This",
"function",
"extracts",
"all",
"code",
"strings",
"from",
"the",
"placeholder",
"items",
"of",
"the",
"provided",
"Ids",
"within",
"the",
"cart",
"."
] | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Checkout/Promotion/Cart/CartPromotionsCollector.php#L237-L260 |
shopware/platform | src/Core/Checkout/Promotion/Cart/CartPromotionsCollector.php | CartPromotionsCollector.searchPromotions | private function searchPromotions(array $codes, SalesChannelContext $context): array
{
/* @var PromotionCollection $codePromotions */
$codePromotions = $this->promotionGateway->getByCodes($codes, $context);
/** @var PromotionCollection $automaticPromotions */
$automaticPromotions = ... | php | private function searchPromotions(array $codes, SalesChannelContext $context): array
{
/* @var PromotionCollection $codePromotions */
$codePromotions = $this->promotionGateway->getByCodes($codes, $context);
/** @var PromotionCollection $automaticPromotions */
$automaticPromotions = ... | [
"private",
"function",
"searchPromotions",
"(",
"array",
"$",
"codes",
",",
"SalesChannelContext",
"$",
"context",
")",
":",
"array",
"{",
"/* @var PromotionCollection $codePromotions */",
"$",
"codePromotions",
"=",
"$",
"this",
"->",
"promotionGateway",
"->",
"getBy... | Gets a combination of all promotion objects that
are valid due to automatic promotions or that have
been manually added by using their codes. | [
"Gets",
"a",
"combination",
"of",
"all",
"promotion",
"objects",
"that",
"are",
"valid",
"due",
"to",
"automatic",
"promotions",
"or",
"that",
"have",
"been",
"manually",
"added",
"by",
"using",
"their",
"codes",
"."
] | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Checkout/Promotion/Cart/CartPromotionsCollector.php#L267-L282 |
shopware/platform | src/Core/Checkout/Promotion/Cart/CartPromotionsCollector.php | CartPromotionsCollector.buildDiscountLineItems | private function buildDiscountLineItems(PromotionEntity $promotion, Cart $cart, SalesChannelContext $context): array
{
/** @var PromotionDiscountCollection|null $collection */
$collection = $promotion->getDiscounts();
if (!$collection instanceof PromotionDiscountCollection) {
re... | php | private function buildDiscountLineItems(PromotionEntity $promotion, Cart $cart, SalesChannelContext $context): array
{
/** @var PromotionDiscountCollection|null $collection */
$collection = $promotion->getDiscounts();
if (!$collection instanceof PromotionDiscountCollection) {
re... | [
"private",
"function",
"buildDiscountLineItems",
"(",
"PromotionEntity",
"$",
"promotion",
",",
"Cart",
"$",
"cart",
",",
"SalesChannelContext",
"$",
"context",
")",
":",
"array",
"{",
"/** @var PromotionDiscountCollection|null $collection */",
"$",
"collection",
"=",
"... | This function builds separate line items for each of the
available discounts within the provided promotion.
Every item will be built with a corresponding price definition based
on the configuration of a discount entity.
The resulting list of line items will then be returned and can
be added to the cart.
The function wi... | [
"This",
"function",
"builds",
"separate",
"line",
"items",
"for",
"each",
"of",
"the",
"available",
"discounts",
"within",
"the",
"provided",
"promotion",
".",
"Every",
"item",
"will",
"be",
"built",
"with",
"a",
"corresponding",
"price",
"definition",
"based",
... | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Checkout/Promotion/Cart/CartPromotionsCollector.php#L296-L343 |
shopware/platform | src/Storefront/Storefront.php | Storefront.build | public function build(ContainerBuilder $container): void
{
parent::build($container);
$loader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/DependencyInjection'));
$loader->load('services.xml');
if ($container->getParameter('kernel.debug')) {
$loader->load... | php | public function build(ContainerBuilder $container): void
{
parent::build($container);
$loader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/DependencyInjection'));
$loader->load('services.xml');
if ($container->getParameter('kernel.debug')) {
$loader->load... | [
"public",
"function",
"build",
"(",
"ContainerBuilder",
"$",
"container",
")",
":",
"void",
"{",
"parent",
"::",
"build",
"(",
"$",
"container",
")",
";",
"$",
"loader",
"=",
"new",
"XmlFileLoader",
"(",
"$",
"container",
",",
"new",
"FileLocator",
"(",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Storefront/Storefront.php#L18-L32 |
shopware/platform | src/Core/Checkout/Cart/SalesChannel/SalesChannelCartController.php | SalesChannelCartController.getCart | public function getCart(Request $request, SalesChannelContext $context): JsonResponse
{
$token = $request->query->getAlnum('token', $context->getToken());
$name = $request->query->getAlnum('name', CartService::SALES_CHANNEL);
$cart = $this->cartService->getCart($token, $context, $name);
... | php | public function getCart(Request $request, SalesChannelContext $context): JsonResponse
{
$token = $request->query->getAlnum('token', $context->getToken());
$name = $request->query->getAlnum('name', CartService::SALES_CHANNEL);
$cart = $this->cartService->getCart($token, $context, $name);
... | [
"public",
"function",
"getCart",
"(",
"Request",
"$",
"request",
",",
"SalesChannelContext",
"$",
"context",
")",
":",
"JsonResponse",
"{",
"$",
"token",
"=",
"$",
"request",
"->",
"query",
"->",
"getAlnum",
"(",
"'token'",
",",
"$",
"context",
"->",
"getT... | @Route("/sales-channel-api/v{version}/checkout/cart", name="sales-channel-api.checkout.cart.detail", methods={"GET"})
@throws CartTokenNotFoundException | [
"@Route",
"(",
"/",
"sales",
"-",
"channel",
"-",
"api",
"/",
"v",
"{",
"version",
"}",
"/",
"checkout",
"/",
"cart",
"name",
"=",
"sales",
"-",
"channel",
"-",
"api",
".",
"checkout",
".",
"cart",
".",
"detail",
"methods",
"=",
"{",
"GET",
"}",
... | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Checkout/Cart/SalesChannel/SalesChannelCartController.php#L61-L69 |
shopware/platform | src/Core/Checkout/Cart/SalesChannel/SalesChannelCartController.php | SalesChannelCartController.createCart | public function createCart(Request $request, SalesChannelContext $context): JsonResponse
{
$token = $request->request->getAlnum('token', $context->getToken());
$name = $request->request->getAlnum('name', CartService::SALES_CHANNEL);
$this->cartService->createNew($token, $name);
ret... | php | public function createCart(Request $request, SalesChannelContext $context): JsonResponse
{
$token = $request->request->getAlnum('token', $context->getToken());
$name = $request->request->getAlnum('name', CartService::SALES_CHANNEL);
$this->cartService->createNew($token, $name);
ret... | [
"public",
"function",
"createCart",
"(",
"Request",
"$",
"request",
",",
"SalesChannelContext",
"$",
"context",
")",
":",
"JsonResponse",
"{",
"$",
"token",
"=",
"$",
"request",
"->",
"request",
"->",
"getAlnum",
"(",
"'token'",
",",
"$",
"context",
"->",
... | @Route("/sales-channel-api/v{version}/checkout/cart", name="sales-channel-api.checkout.cart.create", methods={"POST"})
@throws CartTokenNotFoundException | [
"@Route",
"(",
"/",
"sales",
"-",
"channel",
"-",
"api",
"/",
"v",
"{",
"version",
"}",
"/",
"checkout",
"/",
"cart",
"name",
"=",
"sales",
"-",
"channel",
"-",
"api",
".",
"checkout",
".",
"cart",
".",
"create",
"methods",
"=",
"{",
"POST",
"}",
... | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Checkout/Cart/SalesChannel/SalesChannelCartController.php#L76-L88 |
shopware/platform | src/Core/Checkout/Cart/SalesChannel/SalesChannelCartController.php | SalesChannelCartController.addProduct | public function addProduct(string $id, Request $request, SalesChannelContext $context): JsonResponse
{
$token = $request->request->getAlnum('token', $context->getToken());
$quantity = $request->request->getInt('quantity', 1);
$payload = $request->request->get('payload', []);
$payload... | php | public function addProduct(string $id, Request $request, SalesChannelContext $context): JsonResponse
{
$token = $request->request->getAlnum('token', $context->getToken());
$quantity = $request->request->getInt('quantity', 1);
$payload = $request->request->get('payload', []);
$payload... | [
"public",
"function",
"addProduct",
"(",
"string",
"$",
"id",
",",
"Request",
"$",
"request",
",",
"SalesChannelContext",
"$",
"context",
")",
":",
"JsonResponse",
"{",
"$",
"token",
"=",
"$",
"request",
"->",
"request",
"->",
"getAlnum",
"(",
"'token'",
"... | @Route("/sales-channel-api/v{version}/checkout/cart/product/{id}", name="sales-channel-api.checkout.frontend.cart.product.add", methods={"POST"})
@throws MixedLineItemTypeException
@throws InvalidQuantityException
@throws InvalidPayloadException
@throws CartTokenNotFoundException | [
"@Route",
"(",
"/",
"sales",
"-",
"channel",
"-",
"api",
"/",
"v",
"{",
"version",
"}",
"/",
"checkout",
"/",
"cart",
"/",
"product",
"/",
"{",
"id",
"}",
"name",
"=",
"sales",
"-",
"channel",
"-",
"api",
".",
"checkout",
".",
"frontend",
".",
"c... | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Checkout/Cart/SalesChannel/SalesChannelCartController.php#L98-L113 |
shopware/platform | src/Core/Checkout/Cart/SalesChannel/SalesChannelCartController.php | SalesChannelCartController.addCode | public function addCode(string $code, Request $request, SalesChannelContext $context): JsonResponse
{
/** @var string $token */
$token = $request->request->getAlnum('token', $context->getToken());
$itemBuilder = new PromotionItemBuilder(CartPromotionsCollector::LINE_ITEM_TYPE);
$li... | php | public function addCode(string $code, Request $request, SalesChannelContext $context): JsonResponse
{
/** @var string $token */
$token = $request->request->getAlnum('token', $context->getToken());
$itemBuilder = new PromotionItemBuilder(CartPromotionsCollector::LINE_ITEM_TYPE);
$li... | [
"public",
"function",
"addCode",
"(",
"string",
"$",
"code",
",",
"Request",
"$",
"request",
",",
"SalesChannelContext",
"$",
"context",
")",
":",
"JsonResponse",
"{",
"/** @var string $token */",
"$",
"token",
"=",
"$",
"request",
"->",
"request",
"->",
"getA... | Adds the provided promotion code to the cart and recalculates it.
The code will be added as a separate promotion placeholder line item.
That one will be replaced with a real promotion (if valid) within the
promotion collector service.
@Route("/sales-channel-api/v{version}/checkout/cart/code/{code}", name="sales-channe... | [
"Adds",
"the",
"provided",
"promotion",
"code",
"to",
"the",
"cart",
"and",
"recalculates",
"it",
".",
"The",
"code",
"will",
"be",
"added",
"as",
"a",
"separate",
"promotion",
"placeholder",
"line",
"item",
".",
"That",
"one",
"will",
"be",
"replaced",
"w... | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Checkout/Cart/SalesChannel/SalesChannelCartController.php#L127-L142 |
shopware/platform | src/Core/Checkout/Cart/SalesChannel/SalesChannelCartController.php | SalesChannelCartController.addLineItem | public function addLineItem(string $id, RequestDataBag $requestDataBag, SalesChannelContext $context): JsonResponse
{
// todo support price definition (NEXT-573)
$token = $requestDataBag->getAlnum('token', $context->getToken());
$type = $requestDataBag->getAlnum('type');
$quantity =... | php | public function addLineItem(string $id, RequestDataBag $requestDataBag, SalesChannelContext $context): JsonResponse
{
// todo support price definition (NEXT-573)
$token = $requestDataBag->getAlnum('token', $context->getToken());
$type = $requestDataBag->getAlnum('type');
$quantity =... | [
"public",
"function",
"addLineItem",
"(",
"string",
"$",
"id",
",",
"RequestDataBag",
"$",
"requestDataBag",
",",
"SalesChannelContext",
"$",
"context",
")",
":",
"JsonResponse",
"{",
"// todo support price definition (NEXT-573)",
"$",
"token",
"=",
"$",
"requestDataB... | @Route("/sales-channel-api/v{version}/checkout/cart/line-item/{id}", name="sales-channel-api.checkout.cart.line-item.add", methods={"POST"})
@throws MissingRequestParameterException
@throws MixedLineItemTypeException
@throws InvalidQuantityException
@throws LineItemCoverNotFoundException
@throws LineItemNotStackableEx... | [
"@Route",
"(",
"/",
"sales",
"-",
"channel",
"-",
"api",
"/",
"v",
"{",
"version",
"}",
"/",
"checkout",
"/",
"cart",
"/",
"line",
"-",
"item",
"/",
"{",
"id",
"}",
"name",
"=",
"sales",
"-",
"channel",
"-",
"api",
".",
"checkout",
".",
"cart",
... | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Checkout/Cart/SalesChannel/SalesChannelCartController.php#L155-L174 |
shopware/platform | src/Core/Checkout/Cart/SalesChannel/SalesChannelCartController.php | SalesChannelCartController.removeLineItem | public function removeLineItem(string $id, Request $request, SalesChannelContext $context): JsonResponse
{
$token = $request->request->getAlnum('token', $context->getToken());
$cart = $this->cartService->getCart($token, $context);
if (!$cart->has($id)) {
throw new LineItemNotFo... | php | public function removeLineItem(string $id, Request $request, SalesChannelContext $context): JsonResponse
{
$token = $request->request->getAlnum('token', $context->getToken());
$cart = $this->cartService->getCart($token, $context);
if (!$cart->has($id)) {
throw new LineItemNotFo... | [
"public",
"function",
"removeLineItem",
"(",
"string",
"$",
"id",
",",
"Request",
"$",
"request",
",",
"SalesChannelContext",
"$",
"context",
")",
":",
"JsonResponse",
"{",
"$",
"token",
"=",
"$",
"request",
"->",
"request",
"->",
"getAlnum",
"(",
"'token'",... | @Route("/sales-channel-api/v{version}/checkout/cart/line-item/{id}", name="sales-channel-api.checkout.cart.line-item.delete", methods={"DELETE"})
@throws LineItemNotFoundException
@throws LineItemNotRemovableException
@throws CartTokenNotFoundException | [
"@Route",
"(",
"/",
"sales",
"-",
"channel",
"-",
"api",
"/",
"v",
"{",
"version",
"}",
"/",
"checkout",
"/",
"cart",
"/",
"line",
"-",
"item",
"/",
"{",
"id",
"}",
"name",
"=",
"sales",
"-",
"channel",
"-",
"api",
".",
"checkout",
".",
"cart",
... | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Checkout/Cart/SalesChannel/SalesChannelCartController.php#L183-L196 |
shopware/platform | src/Core/Checkout/Cart/SalesChannel/SalesChannelCartController.php | SalesChannelCartController.updateLineItem | public function updateLineItem(string $id, RequestDataBag $requestDataBag, SalesChannelContext $context): JsonResponse
{
$token = $requestDataBag->getAlnum('token', $context->getToken());
$cart = $this->cartService->getCart($token, $context);
if (!$cart->has($id)) {
throw new Li... | php | public function updateLineItem(string $id, RequestDataBag $requestDataBag, SalesChannelContext $context): JsonResponse
{
$token = $requestDataBag->getAlnum('token', $context->getToken());
$cart = $this->cartService->getCart($token, $context);
if (!$cart->has($id)) {
throw new Li... | [
"public",
"function",
"updateLineItem",
"(",
"string",
"$",
"id",
",",
"RequestDataBag",
"$",
"requestDataBag",
",",
"SalesChannelContext",
"$",
"context",
")",
":",
"JsonResponse",
"{",
"$",
"token",
"=",
"$",
"requestDataBag",
"->",
"getAlnum",
"(",
"'token'",... | @Route("/sales-channel-api/v{version}/checkout/cart/line-item/{id}", name="sales-channel-api.checkout.cart.line-item.update", methods={"PATCH"})
@throws InvalidQuantityException
@throws LineItemNotFoundException
@throws LineItemNotStackableException
@throws LineItemCoverNotFoundException
@throws CartTokenNotFoundExcep... | [
"@Route",
"(",
"/",
"sales",
"-",
"channel",
"-",
"api",
"/",
"v",
"{",
"version",
"}",
"/",
"checkout",
"/",
"cart",
"/",
"line",
"-",
"item",
"/",
"{",
"id",
"}",
"name",
"=",
"sales",
"-",
"channel",
"-",
"api",
".",
"checkout",
".",
"cart",
... | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Checkout/Cart/SalesChannel/SalesChannelCartController.php#L208-L224 |
shopware/platform | src/Core/Checkout/Cart/Order/Api/OrderRecalculationController.php | OrderRecalculationController.recalculateOrder | public function recalculateOrder(string $orderId, Context $context): Response
{
$this->recalculationService->recalculateOrder($orderId, $context);
return new Response(null, Response::HTTP_NO_CONTENT);
} | php | public function recalculateOrder(string $orderId, Context $context): Response
{
$this->recalculationService->recalculateOrder($orderId, $context);
return new Response(null, Response::HTTP_NO_CONTENT);
} | [
"public",
"function",
"recalculateOrder",
"(",
"string",
"$",
"orderId",
",",
"Context",
"$",
"context",
")",
":",
"Response",
"{",
"$",
"this",
"->",
"recalculationService",
"->",
"recalculateOrder",
"(",
"$",
"orderId",
",",
"$",
"context",
")",
";",
"retu... | @Route("/api/v{version}/_action/order/{orderId}/recalculate", name="api.action.order.recalculate", methods={"POST"})
@throws CustomerNotLoggedInException
@throws InvalidPayloadException
@throws InvalidQuantityException
@throws LineItemNotStackableException
@throws MixedLineItemTypeException
@throws InvalidOrderExcepti... | [
"@Route",
"(",
"/",
"api",
"/",
"v",
"{",
"version",
"}",
"/",
"_action",
"/",
"order",
"/",
"{",
"orderId",
"}",
"/",
"recalculate",
"name",
"=",
"api",
".",
"action",
".",
"order",
".",
"recalculate",
"methods",
"=",
"{",
"POST",
"}",
")"
] | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Checkout/Cart/Order/Api/OrderRecalculationController.php#L56-L61 |
shopware/platform | src/Core/Checkout/Cart/Order/Api/OrderRecalculationController.php | OrderRecalculationController.addProductToOrder | public function addProductToOrder(string $orderId, string $productId, Request $request, Context $context): Response
{
$quantity = $request->request->getInt('quantity', 1);
$this->recalculationService->addProductToOrder($orderId, $productId, $quantity, $context);
return new Response(null, Re... | php | public function addProductToOrder(string $orderId, string $productId, Request $request, Context $context): Response
{
$quantity = $request->request->getInt('quantity', 1);
$this->recalculationService->addProductToOrder($orderId, $productId, $quantity, $context);
return new Response(null, Re... | [
"public",
"function",
"addProductToOrder",
"(",
"string",
"$",
"orderId",
",",
"string",
"$",
"productId",
",",
"Request",
"$",
"request",
",",
"Context",
"$",
"context",
")",
":",
"Response",
"{",
"$",
"quantity",
"=",
"$",
"request",
"->",
"request",
"->... | @Route("/api/v{version}/_action/order/{orderId}/product/{productId}", name="api.action.order.add-product", methods={"POST"})
@throws DeliveryWithoutAddressException
@throws InconsistentCriteriaIdsException
@throws InvalidOrderException
@throws InvalidPayloadException
@throws InvalidQuantityException
@throws LineItemNo... | [
"@Route",
"(",
"/",
"api",
"/",
"v",
"{",
"version",
"}",
"/",
"_action",
"/",
"order",
"/",
"{",
"orderId",
"}",
"/",
"product",
"/",
"{",
"productId",
"}",
"name",
"=",
"api",
".",
"action",
".",
"order",
".",
"add",
"-",
"product",
"methods",
... | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Checkout/Cart/Order/Api/OrderRecalculationController.php#L77-L83 |
shopware/platform | src/Core/Checkout/Cart/Order/Api/OrderRecalculationController.php | OrderRecalculationController.addCreditItemToOrder | public function addCreditItemToOrder(string $orderId, Request $request, Context $context)
{
$identifier = $request->request->get('identifier');
$type = LineItem::CREDIT_LINE_ITEM_TYPE;
$quantity = $request->request->getInt('quantity', 1);
$lineItem = new LineItem($identifier, $type,... | php | public function addCreditItemToOrder(string $orderId, Request $request, Context $context)
{
$identifier = $request->request->get('identifier');
$type = LineItem::CREDIT_LINE_ITEM_TYPE;
$quantity = $request->request->getInt('quantity', 1);
$lineItem = new LineItem($identifier, $type,... | [
"public",
"function",
"addCreditItemToOrder",
"(",
"string",
"$",
"orderId",
",",
"Request",
"$",
"request",
",",
"Context",
"$",
"context",
")",
"{",
"$",
"identifier",
"=",
"$",
"request",
"->",
"request",
"->",
"get",
"(",
"'identifier'",
")",
";",
"$",... | @Route("/api/v{version}/_action/order/{orderId}/creditItem", name="api.action.order.add-credit-item", methods={"POST"}) | [
"@Route",
"(",
"/",
"api",
"/",
"v",
"{",
"version",
"}",
"/",
"_action",
"/",
"order",
"/",
"{",
"orderId",
"}",
"/",
"creditItem",
"name",
"=",
"api",
".",
"action",
".",
"order",
".",
"add",
"-",
"credit",
"-",
"item",
"methods",
"=",
"{",
"PO... | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Checkout/Cart/Order/Api/OrderRecalculationController.php#L89-L120 |
shopware/platform | src/Core/Checkout/Cart/Order/Api/OrderRecalculationController.php | OrderRecalculationController.addCustomLineItemToOrder | public function addCustomLineItemToOrder(string $orderId, Request $request, Context $context): Response
{
$identifier = $request->request->get('identifier');
$type = $request->request->get('type', LineItem::PRODUCT_LINE_ITEM_TYPE);
$quantity = $request->request->getInt('quantity', 1);
... | php | public function addCustomLineItemToOrder(string $orderId, Request $request, Context $context): Response
{
$identifier = $request->request->get('identifier');
$type = $request->request->get('type', LineItem::PRODUCT_LINE_ITEM_TYPE);
$quantity = $request->request->getInt('quantity', 1);
... | [
"public",
"function",
"addCustomLineItemToOrder",
"(",
"string",
"$",
"orderId",
",",
"Request",
"$",
"request",
",",
"Context",
"$",
"context",
")",
":",
"Response",
"{",
"$",
"identifier",
"=",
"$",
"request",
"->",
"request",
"->",
"get",
"(",
"'identifie... | @Route("/api/v{version}/_action/order/{orderId}/lineItem", name="api.action.order.add-line-item", methods={"POST"})
@throws DeliveryWithoutAddressException
@throws InvalidOrderException
@throws InvalidPayloadException
@throws InvalidQuantityException
@throws LineItemNotStackableException
@throws MixedLineItemTypeExcep... | [
"@Route",
"(",
"/",
"api",
"/",
"v",
"{",
"version",
"}",
"/",
"_action",
"/",
"order",
"/",
"{",
"orderId",
"}",
"/",
"lineItem",
"name",
"=",
"api",
".",
"action",
".",
"order",
".",
"add",
"-",
"line",
"-",
"item",
"methods",
"=",
"{",
"POST",... | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Checkout/Cart/Order/Api/OrderRecalculationController.php#L135-L147 |
shopware/platform | src/Core/Checkout/Cart/Order/Api/OrderRecalculationController.php | OrderRecalculationController.replaceOrderAddressWithCustomerAddress | public function replaceOrderAddressWithCustomerAddress(string $orderAddressId, string $customerAddressId, Context $context): JsonResponse
{
$this->recalculationService->replaceOrderAddressWithCustomerAddress($orderAddressId, $customerAddressId, $context);
return new JsonResponse(null, Response::HTT... | php | public function replaceOrderAddressWithCustomerAddress(string $orderAddressId, string $customerAddressId, Context $context): JsonResponse
{
$this->recalculationService->replaceOrderAddressWithCustomerAddress($orderAddressId, $customerAddressId, $context);
return new JsonResponse(null, Response::HTT... | [
"public",
"function",
"replaceOrderAddressWithCustomerAddress",
"(",
"string",
"$",
"orderAddressId",
",",
"string",
"$",
"customerAddressId",
",",
"Context",
"$",
"context",
")",
":",
"JsonResponse",
"{",
"$",
"this",
"->",
"recalculationService",
"->",
"replaceOrder... | @Route("/api/v{version}/_action/order-address/{orderAddressId}/customer-address/{customerAddressId}", name="api.action.order.replace-order-address", methods={"POST"})
@throws OrderRecalculationException
@throws InconsistentCriteriaIdsException | [
"@Route",
"(",
"/",
"api",
"/",
"v",
"{",
"version",
"}",
"/",
"_action",
"/",
"order",
"-",
"address",
"/",
"{",
"orderAddressId",
"}",
"/",
"customer",
"-",
"address",
"/",
"{",
"customerAddressId",
"}",
"name",
"=",
"api",
".",
"action",
".",
"ord... | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Checkout/Cart/Order/Api/OrderRecalculationController.php#L155-L160 |
shopware/platform | src/Core/Checkout/Cart/SalesChannel/SalesChannelCheckoutController.php | SalesChannelCheckoutController.createOrder | public function createOrder(Request $request, SalesChannelContext $context): JsonResponse
{
$token = $request->request->getAlnum('token', $context->getToken());
$cart = $this->cartService->getCart($token, $context);
$orderId = $this->cartService->order($cart, $context);
$order = $th... | php | public function createOrder(Request $request, SalesChannelContext $context): JsonResponse
{
$token = $request->request->getAlnum('token', $context->getToken());
$cart = $this->cartService->getCart($token, $context);
$orderId = $this->cartService->order($cart, $context);
$order = $th... | [
"public",
"function",
"createOrder",
"(",
"Request",
"$",
"request",
",",
"SalesChannelContext",
"$",
"context",
")",
":",
"JsonResponse",
"{",
"$",
"token",
"=",
"$",
"request",
"->",
"request",
"->",
"getAlnum",
"(",
"'token'",
",",
"$",
"context",
"->",
... | @Route("/sales-channel-api/v{version}/checkout/order", name="sales-channel-api.checkout.order.create", methods={"POST"})
@throws OrderNotFoundException
@throws CartTokenNotFoundException | [
"@Route",
"(",
"/",
"sales",
"-",
"channel",
"-",
"api",
"/",
"v",
"{",
"version",
"}",
"/",
"checkout",
"/",
"order",
"name",
"=",
"sales",
"-",
"channel",
"-",
"api",
".",
"checkout",
".",
"order",
".",
"create",
"methods",
"=",
"{",
"POST",
"}",... | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Checkout/Cart/SalesChannel/SalesChannelCheckoutController.php#L91-L102 |
shopware/platform | src/Core/Checkout/Cart/SalesChannel/SalesChannelCheckoutController.php | SalesChannelCheckoutController.createGuestOrder | public function createGuestOrder(Request $request, RequestDataBag $data, SalesChannelContext $context): JsonResponse
{
$token = $request->request->getAlnum('token', $context->getToken());
$request->request->remove('token');
$customerId = $this->accountRegisterService->register($data, true, ... | php | public function createGuestOrder(Request $request, RequestDataBag $data, SalesChannelContext $context): JsonResponse
{
$token = $request->request->getAlnum('token', $context->getToken());
$request->request->remove('token');
$customerId = $this->accountRegisterService->register($data, true, ... | [
"public",
"function",
"createGuestOrder",
"(",
"Request",
"$",
"request",
",",
"RequestDataBag",
"$",
"data",
",",
"SalesChannelContext",
"$",
"context",
")",
":",
"JsonResponse",
"{",
"$",
"token",
"=",
"$",
"request",
"->",
"request",
"->",
"getAlnum",
"(",
... | @Route("/sales-channel-api/v{version}/checkout/guest-order", name="sales-channel-api.checkout.guest-order.create", methods={"POST"})
@throws OrderNotFoundException
@throws CartTokenNotFoundException | [
"@Route",
"(",
"/",
"sales",
"-",
"channel",
"-",
"api",
"/",
"v",
"{",
"version",
"}",
"/",
"checkout",
"/",
"guest",
"-",
"order",
"name",
"=",
"sales",
"-",
"channel",
"-",
"api",
".",
"checkout",
".",
"guest",
"-",
"order",
".",
"create",
"meth... | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Checkout/Cart/SalesChannel/SalesChannelCheckoutController.php#L110-L124 |
shopware/platform | src/Core/Checkout/Cart/SalesChannel/SalesChannelCheckoutController.php | SalesChannelCheckoutController.getDeepLinkOrder | public function getDeepLinkOrder(string $id, Request $request, Context $context): JsonResponse
{
$deepLinkCode = (string) $request->query->get('accessCode');
if ($id === '' || \strlen($deepLinkCode) !== 32) {
throw new OrderNotFoundException($id);
}
$criteria = new Crit... | php | public function getDeepLinkOrder(string $id, Request $request, Context $context): JsonResponse
{
$deepLinkCode = (string) $request->query->get('accessCode');
if ($id === '' || \strlen($deepLinkCode) !== 32) {
throw new OrderNotFoundException($id);
}
$criteria = new Crit... | [
"public",
"function",
"getDeepLinkOrder",
"(",
"string",
"$",
"id",
",",
"Request",
"$",
"request",
",",
"Context",
"$",
"context",
")",
":",
"JsonResponse",
"{",
"$",
"deepLinkCode",
"=",
"(",
"string",
")",
"$",
"request",
"->",
"query",
"->",
"get",
"... | @Route("/sales-channel-api/v{version}/checkout/guest-order/{id}", defaults={"auth_required"=false}, name="sales-channel-api.checkout.guest-order.detail", methods={"GET"})
@throws OrderNotFoundException | [
"@Route",
"(",
"/",
"sales",
"-",
"channel",
"-",
"api",
"/",
"v",
"{",
"version",
"}",
"/",
"checkout",
"/",
"guest",
"-",
"order",
"/",
"{",
"id",
"}",
"defaults",
"=",
"{",
"auth_required",
"=",
"false",
"}",
"name",
"=",
"sales",
"-",
"channel"... | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Checkout/Cart/SalesChannel/SalesChannelCheckoutController.php#L131-L150 |
shopware/platform | src/Core/Checkout/Cart/SalesChannel/SalesChannelCheckoutController.php | SalesChannelCheckoutController.payOrder | public function payOrder(string $orderId, Request $request, SalesChannelContext $context): Response
{
$finishUrl = $request->request->get('finishUrl');
$response = $this->paymentService->handlePaymentByOrder($orderId, $context, $finishUrl);
if ($response) {
return new JsonRespon... | php | public function payOrder(string $orderId, Request $request, SalesChannelContext $context): Response
{
$finishUrl = $request->request->get('finishUrl');
$response = $this->paymentService->handlePaymentByOrder($orderId, $context, $finishUrl);
if ($response) {
return new JsonRespon... | [
"public",
"function",
"payOrder",
"(",
"string",
"$",
"orderId",
",",
"Request",
"$",
"request",
",",
"SalesChannelContext",
"$",
"context",
")",
":",
"Response",
"{",
"$",
"finishUrl",
"=",
"$",
"request",
"->",
"request",
"->",
"get",
"(",
"'finishUrl'",
... | @Route("/sales-channel-api/v{version}/checkout/order/{orderId}/pay", name="sales-channel-api.checkout.order.pay", methods={"POST"})
@throws AsyncPaymentProcessException
@throws InvalidOrderException
@throws SyncPaymentProcessException
@throws UnknownPaymentMethodException | [
"@Route",
"(",
"/",
"sales",
"-",
"channel",
"-",
"api",
"/",
"v",
"{",
"version",
"}",
"/",
"checkout",
"/",
"order",
"/",
"{",
"orderId",
"}",
"/",
"pay",
"name",
"=",
"sales",
"-",
"channel",
"-",
"api",
".",
"checkout",
".",
"order",
".",
"pa... | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Checkout/Cart/SalesChannel/SalesChannelCheckoutController.php#L160-L170 |
shopware/platform | src/Core/Checkout/Cart/Tax/Struct/CalculatedTaxCollection.php | CalculatedTaxCollection.getAmount | public function getAmount(): float
{
$amounts = $this->map(
function (CalculatedTax $calculatedTax) {
return $calculatedTax->getTax();
}
);
return array_sum($amounts);
} | php | public function getAmount(): float
{
$amounts = $this->map(
function (CalculatedTax $calculatedTax) {
return $calculatedTax->getTax();
}
);
return array_sum($amounts);
} | [
"public",
"function",
"getAmount",
"(",
")",
":",
"float",
"{",
"$",
"amounts",
"=",
"$",
"this",
"->",
"map",
"(",
"function",
"(",
"CalculatedTax",
"$",
"calculatedTax",
")",
"{",
"return",
"$",
"calculatedTax",
"->",
"getTax",
"(",
")",
";",
"}",
")... | Returns the total calculated tax for this item | [
"Returns",
"the",
"total",
"calculated",
"tax",
"for",
"this",
"item"
] | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Checkout/Cart/Tax/Struct/CalculatedTaxCollection.php#L47-L56 |
shopware/platform | src/Core/Content/Media/Commands/DeleteNotUsedMediaCommand.php | DeleteNotUsedMediaCommand.execute | protected function execute(InputInterface $input, OutputInterface $output)
{
$io = new SymfonyStyle($input, $output);
$context = Context::createDefaultContext();
$count = $this->deleteMediaService->countNotUsedMedia($context);
if ($count === 0) {
$io->comment('No unuse... | php | protected function execute(InputInterface $input, OutputInterface $output)
{
$io = new SymfonyStyle($input, $output);
$context = Context::createDefaultContext();
$count = $this->deleteMediaService->countNotUsedMedia($context);
if ($count === 0) {
$io->comment('No unuse... | [
"protected",
"function",
"execute",
"(",
"InputInterface",
"$",
"input",
",",
"OutputInterface",
"$",
"output",
")",
"{",
"$",
"io",
"=",
"new",
"SymfonyStyle",
"(",
"$",
"input",
",",
"$",
"output",
")",
";",
"$",
"context",
"=",
"Context",
"::",
"creat... | {@inheritdoc} | [
"{"
] | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Content/Media/Commands/DeleteNotUsedMediaCommand.php#L40-L64 |
shopware/platform | src/Core/Framework/Language/LanguageValidator.php | LanguageValidator.getAffectedIds | private function getAffectedIds(array $commands): array
{
$ids = [];
foreach ($commands as $command) {
if ($command->getDefinition()->getClass() !== LanguageDefinition::class) {
continue;
}
if ($command instanceof InsertCommand || $command instance... | php | private function getAffectedIds(array $commands): array
{
$ids = [];
foreach ($commands as $command) {
if ($command->getDefinition()->getClass() !== LanguageDefinition::class) {
continue;
}
if ($command instanceof InsertCommand || $command instance... | [
"private",
"function",
"getAffectedIds",
"(",
"array",
"$",
"commands",
")",
":",
"array",
"{",
"$",
"ids",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"commands",
"as",
"$",
"command",
")",
"{",
"if",
"(",
"$",
"command",
"->",
"getDefinition",
"(",
")... | @param WriteCommandInterface[] $commands
@return string[] | [
"@param",
"WriteCommandInterface",
"[]",
"$commands"
] | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Framework/Language/LanguageValidator.php#L156-L169 |
shopware/platform | src/Core/Framework/Api/OAuth/ScopeRepository.php | ScopeRepository.finalizeScopes | public function finalizeScopes(
array $scopes,
$grantType,
ClientEntityInterface $clientEntity,
$userIdentifier = null
): array {
$hasWrite = false;
if ($grantType === 'password') {
$hasWrite = true;
}
if ($grantType === 'client_credentia... | php | public function finalizeScopes(
array $scopes,
$grantType,
ClientEntityInterface $clientEntity,
$userIdentifier = null
): array {
$hasWrite = false;
if ($grantType === 'password') {
$hasWrite = true;
}
if ($grantType === 'client_credentia... | [
"public",
"function",
"finalizeScopes",
"(",
"array",
"$",
"scopes",
",",
"$",
"grantType",
",",
"ClientEntityInterface",
"$",
"clientEntity",
",",
"$",
"userIdentifier",
"=",
"null",
")",
":",
"array",
"{",
"$",
"hasWrite",
"=",
"false",
";",
"if",
"(",
"... | {@inheritdoc} | [
"{"
] | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Framework/Api/OAuth/ScopeRepository.php#L42-L71 |
shopware/platform | src/Core/Checkout/Customer/Validation/CustomerValidationService.php | CustomerValidationService.merge | private function merge(DataValidationDefinition $definition, DataValidationDefinition $profileDefinition): void
{
foreach ($profileDefinition->getProperties() as $key => $constraints) {
$parameters = [];
$parameters[] = $key;
$parameters = array_merge($parameters, $constr... | php | private function merge(DataValidationDefinition $definition, DataValidationDefinition $profileDefinition): void
{
foreach ($profileDefinition->getProperties() as $key => $constraints) {
$parameters = [];
$parameters[] = $key;
$parameters = array_merge($parameters, $constr... | [
"private",
"function",
"merge",
"(",
"DataValidationDefinition",
"$",
"definition",
",",
"DataValidationDefinition",
"$",
"profileDefinition",
")",
":",
"void",
"{",
"foreach",
"(",
"$",
"profileDefinition",
"->",
"getProperties",
"(",
")",
"as",
"$",
"key",
"=>",... | merges constraints from the second definition into the first validation definition | [
"merges",
"constraints",
"from",
"the",
"second",
"definition",
"into",
"the",
"first",
"validation",
"definition"
] | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Checkout/Customer/Validation/CustomerValidationService.php#L62-L71 |
shopware/platform | src/Core/Checkout/Cart/Price/AmountCalculator.php | AmountCalculator.calculateNetDeliveryAmount | private function calculateNetDeliveryAmount(PriceCollection $prices, PriceCollection $shippingCosts): CartPrice
{
$positionPrice = $prices->sum();
$total = $positionPrice->getTotalPrice() + $shippingCosts->sum()->getTotalPrice();
return new CartPrice(
$total,
$total... | php | private function calculateNetDeliveryAmount(PriceCollection $prices, PriceCollection $shippingCosts): CartPrice
{
$positionPrice = $prices->sum();
$total = $positionPrice->getTotalPrice() + $shippingCosts->sum()->getTotalPrice();
return new CartPrice(
$total,
$total... | [
"private",
"function",
"calculateNetDeliveryAmount",
"(",
"PriceCollection",
"$",
"prices",
",",
"PriceCollection",
"$",
"shippingCosts",
")",
":",
"CartPrice",
"{",
"$",
"positionPrice",
"=",
"$",
"prices",
"->",
"sum",
"(",
")",
";",
"$",
"total",
"=",
"$",
... | Calculates the amount for a new delivery.
`CalculatedPrice::price` and `CalculatedPrice::netPrice` are equals and taxes are empty. | [
"Calculates",
"the",
"amount",
"for",
"a",
"new",
"delivery",
".",
"CalculatedPrice",
"::",
"price",
"and",
"CalculatedPrice",
"::",
"netPrice",
"are",
"equals",
"and",
"taxes",
"are",
"empty",
"."
] | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Checkout/Cart/Price/AmountCalculator.php#L56-L70 |
shopware/platform | src/Core/Checkout/Cart/Price/AmountCalculator.php | AmountCalculator.calculateGrossAmount | private function calculateGrossAmount(PriceCollection $prices, PriceCollection $shippingCosts, SalesChannelContext $context): CartPrice
{
$allPrices = $prices->merge($shippingCosts);
$total = $allPrices->sum();
$positionPrice = $prices->sum();
$taxes = $this->taxAmountCalculator->... | php | private function calculateGrossAmount(PriceCollection $prices, PriceCollection $shippingCosts, SalesChannelContext $context): CartPrice
{
$allPrices = $prices->merge($shippingCosts);
$total = $allPrices->sum();
$positionPrice = $prices->sum();
$taxes = $this->taxAmountCalculator->... | [
"private",
"function",
"calculateGrossAmount",
"(",
"PriceCollection",
"$",
"prices",
",",
"PriceCollection",
"$",
"shippingCosts",
",",
"SalesChannelContext",
"$",
"context",
")",
":",
"CartPrice",
"{",
"$",
"allPrices",
"=",
"$",
"prices",
"->",
"merge",
"(",
... | Calculates the amount for a gross delivery.
`CalculatedPrice::netPrice` contains the summed gross prices minus amount of calculated taxes.
`CalculatedPrice::price` contains the summed gross prices
Calculated taxes are based on the gross prices | [
"Calculates",
"the",
"amount",
"for",
"a",
"gross",
"delivery",
".",
"CalculatedPrice",
"::",
"netPrice",
"contains",
"the",
"summed",
"gross",
"prices",
"minus",
"amount",
"of",
"calculated",
"taxes",
".",
"CalculatedPrice",
"::",
"price",
"contains",
"the",
"s... | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Checkout/Cart/Price/AmountCalculator.php#L78-L99 |
shopware/platform | src/Core/Checkout/Cart/Price/AmountCalculator.php | AmountCalculator.calculateNetAmount | private function calculateNetAmount(PriceCollection $prices, PriceCollection $shippingCosts, SalesChannelContext $context): CartPrice
{
$all = $prices->merge($shippingCosts);
$total = $all->sum();
$taxes = $this->taxAmountCalculator->calculate($all, $context);
$gross = $total->get... | php | private function calculateNetAmount(PriceCollection $prices, PriceCollection $shippingCosts, SalesChannelContext $context): CartPrice
{
$all = $prices->merge($shippingCosts);
$total = $all->sum();
$taxes = $this->taxAmountCalculator->calculate($all, $context);
$gross = $total->get... | [
"private",
"function",
"calculateNetAmount",
"(",
"PriceCollection",
"$",
"prices",
",",
"PriceCollection",
"$",
"shippingCosts",
",",
"SalesChannelContext",
"$",
"context",
")",
":",
"CartPrice",
"{",
"$",
"all",
"=",
"$",
"prices",
"->",
"merge",
"(",
"$",
"... | Calculates the amount for a net based delivery, but gross prices has be be payed
`CalculatedPrice::netPrice` contains the summed net prices.
`CalculatedPrice::price` contains the summed net prices plus amount of calculated taxes
Calculated taxes are based on the net prices | [
"Calculates",
"the",
"amount",
"for",
"a",
"net",
"based",
"delivery",
"but",
"gross",
"prices",
"has",
"be",
"be",
"payed",
"CalculatedPrice",
"::",
"netPrice",
"contains",
"the",
"summed",
"net",
"prices",
".",
"CalculatedPrice",
"::",
"price",
"contains",
"... | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Checkout/Cart/Price/AmountCalculator.php#L107-L126 |
shopware/platform | src/Core/Framework/MessageQueue/MonitoringBusDecorator.php | MonitoringBusDecorator.dispatch | public function dispatch($message): Envelope
{
$messageName = $this->getMessageName($message);
if ($this->isIncoming($message)) {
$this->decrementMessageQueueSize($messageName);
} else {
$this->incrementMessageQueueSize($messageName);
}
return $this-... | php | public function dispatch($message): Envelope
{
$messageName = $this->getMessageName($message);
if ($this->isIncoming($message)) {
$this->decrementMessageQueueSize($messageName);
} else {
$this->incrementMessageQueueSize($messageName);
}
return $this-... | [
"public",
"function",
"dispatch",
"(",
"$",
"message",
")",
":",
"Envelope",
"{",
"$",
"messageName",
"=",
"$",
"this",
"->",
"getMessageName",
"(",
"$",
"message",
")",
";",
"if",
"(",
"$",
"this",
"->",
"isIncoming",
"(",
"$",
"message",
")",
")",
... | Dispatches the given message to the inner Bus and Logs it.
@param object|Envelope $message | [
"Dispatches",
"the",
"given",
"message",
"to",
"the",
"inner",
"Bus",
"and",
"Logs",
"it",
"."
] | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Framework/MessageQueue/MonitoringBusDecorator.php#L36-L47 |
shopware/platform | src/Core/Content/Cms/SlotDataResolver/SlotDataResolver.php | SlotDataResolver.fetchByIdentifier | private function fetchByIdentifier(array $directReads, SalesChannelContext $context): array
{
$entities = [];
foreach ($directReads as $definitionClass => $ids) {
$definition = $this->definitionRegistry->get($definitionClass);
$repository = $this->getSalesChannelApiReposito... | php | private function fetchByIdentifier(array $directReads, SalesChannelContext $context): array
{
$entities = [];
foreach ($directReads as $definitionClass => $ids) {
$definition = $this->definitionRegistry->get($definitionClass);
$repository = $this->getSalesChannelApiReposito... | [
"private",
"function",
"fetchByIdentifier",
"(",
"array",
"$",
"directReads",
",",
"SalesChannelContext",
"$",
"context",
")",
":",
"array",
"{",
"$",
"entities",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"directReads",
"as",
"$",
"definitionClass",
"=>",
"$"... | @param string[][] $directReads
@throws InconsistentCriteriaIdsException
@return EntitySearchResult[] | [
"@param",
"string",
"[]",
"[]",
"$directReads"
] | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Content/Cms/SlotDataResolver/SlotDataResolver.php#L109-L127 |
shopware/platform | src/Core/Framework/Snippet/Filter/TranslationKeyFilter.php | TranslationKeyFilter.filter | public function filter(array $snippets, $requestFilterValue): array
{
if (empty($requestFilterValue) || !is_array($requestFilterValue)) {
return $snippets;
}
$result = [];
foreach ($snippets as $setId => $set) {
foreach ($set['snippets'] as $translationKey =>... | php | public function filter(array $snippets, $requestFilterValue): array
{
if (empty($requestFilterValue) || !is_array($requestFilterValue)) {
return $snippets;
}
$result = [];
foreach ($snippets as $setId => $set) {
foreach ($set['snippets'] as $translationKey =>... | [
"public",
"function",
"filter",
"(",
"array",
"$",
"snippets",
",",
"$",
"requestFilterValue",
")",
":",
"array",
"{",
"if",
"(",
"empty",
"(",
"$",
"requestFilterValue",
")",
"||",
"!",
"is_array",
"(",
"$",
"requestFilterValue",
")",
")",
"{",
"return",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Framework/Snippet/Filter/TranslationKeyFilter.php#L18-L35 |
shopware/platform | src/Storefront/Pagelet/Menu/Offcanvas/MenuOffcanvasPageletLoader.php | MenuOffcanvasPageletLoader.getCategoryTree | private function getCategoryTree(string $navigationId, SalesChannelContext $context)
{
/** @var Tree $category */
$category = $this->navigationLoader->loadLevel($navigationId, $context);
/** @var CategoryEntity $active */
$active = $category->getActive();
if ($active->getCh... | php | private function getCategoryTree(string $navigationId, SalesChannelContext $context)
{
/** @var Tree $category */
$category = $this->navigationLoader->loadLevel($navigationId, $context);
/** @var CategoryEntity $active */
$active = $category->getActive();
if ($active->getCh... | [
"private",
"function",
"getCategoryTree",
"(",
"string",
"$",
"navigationId",
",",
"SalesChannelContext",
"$",
"context",
")",
"{",
"/** @var Tree $category */",
"$",
"category",
"=",
"$",
"this",
"->",
"navigationLoader",
"->",
"loadLevel",
"(",
"$",
"navigationId"... | returns the category tree for the passed
navigation id
if the category has no children,
the parent category will be used | [
"returns",
"the",
"category",
"tree",
"for",
"the",
"passed",
"navigation",
"id",
"if",
"the",
"category",
"has",
"no",
"children",
"the",
"parent",
"category",
"will",
"be",
"used"
] | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Storefront/Pagelet/Menu/Offcanvas/MenuOffcanvasPageletLoader.php#L56-L69 |
shopware/platform | src/Docs/Resources/current/60-plugin-system/plugins/210-custom-fields/SwagCustomFields/SwagCustomFields.php | SwagCustomFields.getCustomFieldSets | private function getCustomFieldSets(): array
{
return [[
'id' => 'd7e5e8604f8342878105ecd4df2d8645',
'name' => 'swag_backpack',
'config' => [
'label' => [
'de-DE' => 'Rucksack',
'en-GB' => 'Backpack',
... | php | private function getCustomFieldSets(): array
{
return [[
'id' => 'd7e5e8604f8342878105ecd4df2d8645',
'name' => 'swag_backpack',
'config' => [
'label' => [
'de-DE' => 'Rucksack',
'en-GB' => 'Backpack',
... | [
"private",
"function",
"getCustomFieldSets",
"(",
")",
":",
"array",
"{",
"return",
"[",
"[",
"'id'",
"=>",
"'d7e5e8604f8342878105ecd4df2d8645'",
",",
"'name'",
"=>",
"'swag_backpack'",
",",
"'config'",
"=>",
"[",
"'label'",
"=>",
"[",
"'de-DE'",
"=>",
"'Rucksac... | These sets are visible in the administration | [
"These",
"sets",
"are",
"visible",
"in",
"the",
"administration"
] | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Docs/Resources/current/60-plugin-system/plugins/210-custom-fields/SwagCustomFields/SwagCustomFields.php#L54-L120 |
shopware/platform | src/Storefront/Framework/Controller/StorefrontController.php | StorefrontController.renderStorefront | protected function renderStorefront($view, array $parameters = [], ?Response $response = null): Response
{
$view = $this->resolveView($view);
return $this->render($view, $parameters, $response);
} | php | protected function renderStorefront($view, array $parameters = [], ?Response $response = null): Response
{
$view = $this->resolveView($view);
return $this->render($view, $parameters, $response);
} | [
"protected",
"function",
"renderStorefront",
"(",
"$",
"view",
",",
"array",
"$",
"parameters",
"=",
"[",
"]",
",",
"?",
"Response",
"$",
"response",
"=",
"null",
")",
":",
"Response",
"{",
"$",
"view",
"=",
"$",
"this",
"->",
"resolveView",
"(",
"$",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Storefront/Framework/Controller/StorefrontController.php#L19-L24 |
shopware/platform | src/Core/Framework/Filesystem/PrefixFilesystem.php | PrefixFilesystem.stripPath | public function stripPath(string $path): string
{
$prefix = rtrim($this->prefix, '/');
$path = str_replace($prefix, '', $path);
$path = ltrim($path, '/');
return $path;
} | php | public function stripPath(string $path): string
{
$prefix = rtrim($this->prefix, '/');
$path = str_replace($prefix, '', $path);
$path = ltrim($path, '/');
return $path;
} | [
"public",
"function",
"stripPath",
"(",
"string",
"$",
"path",
")",
":",
"string",
"{",
"$",
"prefix",
"=",
"rtrim",
"(",
"$",
"this",
"->",
"prefix",
",",
"'/'",
")",
";",
"$",
"path",
"=",
"str_replace",
"(",
"$",
"prefix",
",",
"''",
",",
"$",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Framework/Filesystem/PrefixFilesystem.php#L28-L35 |
shopware/platform | src/Core/Framework/Filesystem/AbstractFilesystem.php | AbstractFilesystem.has | public function has($path): bool
{
$path = $this->preparePath($path);
return $this->filesystem->has($path);
} | php | public function has($path): bool
{
$path = $this->preparePath($path);
return $this->filesystem->has($path);
} | [
"public",
"function",
"has",
"(",
"$",
"path",
")",
":",
"bool",
"{",
"$",
"path",
"=",
"$",
"this",
"->",
"preparePath",
"(",
"$",
"path",
")",
";",
"return",
"$",
"this",
"->",
"filesystem",
"->",
"has",
"(",
"$",
"path",
")",
";",
"}"
] | {@inheritdoc} | [
"{"
] | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Framework/Filesystem/AbstractFilesystem.php#L24-L29 |
shopware/platform | src/Core/Framework/Filesystem/AbstractFilesystem.php | AbstractFilesystem.read | public function read($path)
{
$path = $this->preparePath($path);
return $this->filesystem->read($path);
} | php | public function read($path)
{
$path = $this->preparePath($path);
return $this->filesystem->read($path);
} | [
"public",
"function",
"read",
"(",
"$",
"path",
")",
"{",
"$",
"path",
"=",
"$",
"this",
"->",
"preparePath",
"(",
"$",
"path",
")",
";",
"return",
"$",
"this",
"->",
"filesystem",
"->",
"read",
"(",
"$",
"path",
")",
";",
"}"
] | {@inheritdoc} | [
"{"
] | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Framework/Filesystem/AbstractFilesystem.php#L34-L39 |
shopware/platform | src/Core/Framework/Filesystem/AbstractFilesystem.php | AbstractFilesystem.readStream | public function readStream($path)
{
$path = $this->preparePath($path);
return $this->filesystem->readStream($path);
} | php | public function readStream($path)
{
$path = $this->preparePath($path);
return $this->filesystem->readStream($path);
} | [
"public",
"function",
"readStream",
"(",
"$",
"path",
")",
"{",
"$",
"path",
"=",
"$",
"this",
"->",
"preparePath",
"(",
"$",
"path",
")",
";",
"return",
"$",
"this",
"->",
"filesystem",
"->",
"readStream",
"(",
"$",
"path",
")",
";",
"}"
] | {@inheritdoc} | [
"{"
] | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Framework/Filesystem/AbstractFilesystem.php#L44-L49 |
shopware/platform | src/Core/Framework/Filesystem/AbstractFilesystem.php | AbstractFilesystem.listContents | public function listContents($directory = '', $recursive = false): array
{
$directory = $this->preparePath($directory);
return array_map(
function ($info) {
$info['dirname'] = $this->stripPath($info['dirname']);
$info['path'] = $this->stripPath($info['pat... | php | public function listContents($directory = '', $recursive = false): array
{
$directory = $this->preparePath($directory);
return array_map(
function ($info) {
$info['dirname'] = $this->stripPath($info['dirname']);
$info['path'] = $this->stripPath($info['pat... | [
"public",
"function",
"listContents",
"(",
"$",
"directory",
"=",
"''",
",",
"$",
"recursive",
"=",
"false",
")",
":",
"array",
"{",
"$",
"directory",
"=",
"$",
"this",
"->",
"preparePath",
"(",
"$",
"directory",
")",
";",
"return",
"array_map",
"(",
"... | {@inheritdoc} | [
"{"
] | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Framework/Filesystem/AbstractFilesystem.php#L54-L67 |
shopware/platform | src/Core/Framework/Filesystem/AbstractFilesystem.php | AbstractFilesystem.getMetadata | public function getMetadata($path)
{
$path = $this->preparePath($path);
$meta = $this->filesystem->getMetadata($path);
$meta['path'] = $this->stripPath($meta['path']);
if (array_key_exists('dirname', $meta)) {
$meta['dirname'] = $this->stripPath($meta['dirname']);
... | php | public function getMetadata($path)
{
$path = $this->preparePath($path);
$meta = $this->filesystem->getMetadata($path);
$meta['path'] = $this->stripPath($meta['path']);
if (array_key_exists('dirname', $meta)) {
$meta['dirname'] = $this->stripPath($meta['dirname']);
... | [
"public",
"function",
"getMetadata",
"(",
"$",
"path",
")",
"{",
"$",
"path",
"=",
"$",
"this",
"->",
"preparePath",
"(",
"$",
"path",
")",
";",
"$",
"meta",
"=",
"$",
"this",
"->",
"filesystem",
"->",
"getMetadata",
"(",
"$",
"path",
")",
";",
"$"... | {@inheritdoc} | [
"{"
] | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Framework/Filesystem/AbstractFilesystem.php#L72-L84 |
shopware/platform | src/Core/Framework/Filesystem/AbstractFilesystem.php | AbstractFilesystem.getSize | public function getSize($path)
{
$path = $this->preparePath($path);
return $this->filesystem->getSize($path);
} | php | public function getSize($path)
{
$path = $this->preparePath($path);
return $this->filesystem->getSize($path);
} | [
"public",
"function",
"getSize",
"(",
"$",
"path",
")",
"{",
"$",
"path",
"=",
"$",
"this",
"->",
"preparePath",
"(",
"$",
"path",
")",
";",
"return",
"$",
"this",
"->",
"filesystem",
"->",
"getSize",
"(",
"$",
"path",
")",
";",
"}"
] | {@inheritdoc} | [
"{"
] | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Framework/Filesystem/AbstractFilesystem.php#L89-L94 |
shopware/platform | src/Core/Framework/Filesystem/AbstractFilesystem.php | AbstractFilesystem.getMimetype | public function getMimetype($path)
{
$path = $this->preparePath($path);
return $this->filesystem->getMimetype($path);
} | php | public function getMimetype($path)
{
$path = $this->preparePath($path);
return $this->filesystem->getMimetype($path);
} | [
"public",
"function",
"getMimetype",
"(",
"$",
"path",
")",
"{",
"$",
"path",
"=",
"$",
"this",
"->",
"preparePath",
"(",
"$",
"path",
")",
";",
"return",
"$",
"this",
"->",
"filesystem",
"->",
"getMimetype",
"(",
"$",
"path",
")",
";",
"}"
] | {@inheritdoc} | [
"{"
] | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Framework/Filesystem/AbstractFilesystem.php#L99-L104 |
shopware/platform | src/Core/Framework/Filesystem/AbstractFilesystem.php | AbstractFilesystem.getTimestamp | public function getTimestamp($path)
{
$path = $this->preparePath($path);
return $this->filesystem->getTimestamp($path);
} | php | public function getTimestamp($path)
{
$path = $this->preparePath($path);
return $this->filesystem->getTimestamp($path);
} | [
"public",
"function",
"getTimestamp",
"(",
"$",
"path",
")",
"{",
"$",
"path",
"=",
"$",
"this",
"->",
"preparePath",
"(",
"$",
"path",
")",
";",
"return",
"$",
"this",
"->",
"filesystem",
"->",
"getTimestamp",
"(",
"$",
"path",
")",
";",
"}"
] | {@inheritdoc} | [
"{"
] | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Framework/Filesystem/AbstractFilesystem.php#L109-L114 |
shopware/platform | src/Core/Framework/Filesystem/AbstractFilesystem.php | AbstractFilesystem.getVisibility | public function getVisibility($path)
{
$path = $this->preparePath($path);
return $this->filesystem->getVisibility($path);
} | php | public function getVisibility($path)
{
$path = $this->preparePath($path);
return $this->filesystem->getVisibility($path);
} | [
"public",
"function",
"getVisibility",
"(",
"$",
"path",
")",
"{",
"$",
"path",
"=",
"$",
"this",
"->",
"preparePath",
"(",
"$",
"path",
")",
";",
"return",
"$",
"this",
"->",
"filesystem",
"->",
"getVisibility",
"(",
"$",
"path",
")",
";",
"}"
] | {@inheritdoc} | [
"{"
] | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Framework/Filesystem/AbstractFilesystem.php#L119-L124 |
shopware/platform | src/Core/Framework/Filesystem/AbstractFilesystem.php | AbstractFilesystem.write | public function write($path, $contents, array $config = []): bool
{
$path = $this->preparePath($path);
return $this->filesystem->write($path, $contents, $config);
} | php | public function write($path, $contents, array $config = []): bool
{
$path = $this->preparePath($path);
return $this->filesystem->write($path, $contents, $config);
} | [
"public",
"function",
"write",
"(",
"$",
"path",
",",
"$",
"contents",
",",
"array",
"$",
"config",
"=",
"[",
"]",
")",
":",
"bool",
"{",
"$",
"path",
"=",
"$",
"this",
"->",
"preparePath",
"(",
"$",
"path",
")",
";",
"return",
"$",
"this",
"->",... | {@inheritdoc} | [
"{"
] | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Framework/Filesystem/AbstractFilesystem.php#L129-L134 |
shopware/platform | src/Core/Framework/Filesystem/AbstractFilesystem.php | AbstractFilesystem.writeStream | public function writeStream($path, $resource, array $config = []): bool
{
$path = $this->preparePath($path);
return $this->filesystem->writeStream($path, $resource, $config);
} | php | public function writeStream($path, $resource, array $config = []): bool
{
$path = $this->preparePath($path);
return $this->filesystem->writeStream($path, $resource, $config);
} | [
"public",
"function",
"writeStream",
"(",
"$",
"path",
",",
"$",
"resource",
",",
"array",
"$",
"config",
"=",
"[",
"]",
")",
":",
"bool",
"{",
"$",
"path",
"=",
"$",
"this",
"->",
"preparePath",
"(",
"$",
"path",
")",
";",
"return",
"$",
"this",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Framework/Filesystem/AbstractFilesystem.php#L139-L144 |
shopware/platform | src/Core/Framework/Filesystem/AbstractFilesystem.php | AbstractFilesystem.update | public function update($path, $contents, array $config = []): bool
{
$path = $this->preparePath($path);
return $this->filesystem->update($path, $contents, $config);
} | php | public function update($path, $contents, array $config = []): bool
{
$path = $this->preparePath($path);
return $this->filesystem->update($path, $contents, $config);
} | [
"public",
"function",
"update",
"(",
"$",
"path",
",",
"$",
"contents",
",",
"array",
"$",
"config",
"=",
"[",
"]",
")",
":",
"bool",
"{",
"$",
"path",
"=",
"$",
"this",
"->",
"preparePath",
"(",
"$",
"path",
")",
";",
"return",
"$",
"this",
"->"... | {@inheritdoc} | [
"{"
] | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Framework/Filesystem/AbstractFilesystem.php#L149-L154 |
shopware/platform | src/Core/Framework/Filesystem/AbstractFilesystem.php | AbstractFilesystem.updateStream | public function updateStream($path, $resource, array $config = []): bool
{
$path = $this->preparePath($path);
return $this->filesystem->updateStream($path, $resource, $config);
} | php | public function updateStream($path, $resource, array $config = []): bool
{
$path = $this->preparePath($path);
return $this->filesystem->updateStream($path, $resource, $config);
} | [
"public",
"function",
"updateStream",
"(",
"$",
"path",
",",
"$",
"resource",
",",
"array",
"$",
"config",
"=",
"[",
"]",
")",
":",
"bool",
"{",
"$",
"path",
"=",
"$",
"this",
"->",
"preparePath",
"(",
"$",
"path",
")",
";",
"return",
"$",
"this",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Framework/Filesystem/AbstractFilesystem.php#L159-L164 |
shopware/platform | src/Core/Framework/Filesystem/AbstractFilesystem.php | AbstractFilesystem.rename | public function rename($path, $newpath): bool
{
$path = $this->preparePath($path);
$newpath = $this->preparePath($newpath);
return $this->filesystem->rename($path, $newpath);
} | php | public function rename($path, $newpath): bool
{
$path = $this->preparePath($path);
$newpath = $this->preparePath($newpath);
return $this->filesystem->rename($path, $newpath);
} | [
"public",
"function",
"rename",
"(",
"$",
"path",
",",
"$",
"newpath",
")",
":",
"bool",
"{",
"$",
"path",
"=",
"$",
"this",
"->",
"preparePath",
"(",
"$",
"path",
")",
";",
"$",
"newpath",
"=",
"$",
"this",
"->",
"preparePath",
"(",
"$",
"newpath"... | {@inheritdoc} | [
"{"
] | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Framework/Filesystem/AbstractFilesystem.php#L169-L175 |
shopware/platform | src/Core/Framework/Filesystem/AbstractFilesystem.php | AbstractFilesystem.copy | public function copy($path, $newpath): bool
{
$path = $this->preparePath($path);
$newpath = $this->preparePath($newpath);
return $this->filesystem->copy($path, $newpath);
} | php | public function copy($path, $newpath): bool
{
$path = $this->preparePath($path);
$newpath = $this->preparePath($newpath);
return $this->filesystem->copy($path, $newpath);
} | [
"public",
"function",
"copy",
"(",
"$",
"path",
",",
"$",
"newpath",
")",
":",
"bool",
"{",
"$",
"path",
"=",
"$",
"this",
"->",
"preparePath",
"(",
"$",
"path",
")",
";",
"$",
"newpath",
"=",
"$",
"this",
"->",
"preparePath",
"(",
"$",
"newpath",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Framework/Filesystem/AbstractFilesystem.php#L180-L186 |
shopware/platform | src/Core/Framework/Filesystem/AbstractFilesystem.php | AbstractFilesystem.delete | public function delete($path): bool
{
$path = $this->preparePath($path);
return $this->filesystem->delete($path);
} | php | public function delete($path): bool
{
$path = $this->preparePath($path);
return $this->filesystem->delete($path);
} | [
"public",
"function",
"delete",
"(",
"$",
"path",
")",
":",
"bool",
"{",
"$",
"path",
"=",
"$",
"this",
"->",
"preparePath",
"(",
"$",
"path",
")",
";",
"return",
"$",
"this",
"->",
"filesystem",
"->",
"delete",
"(",
"$",
"path",
")",
";",
"}"
] | {@inheritdoc} | [
"{"
] | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Framework/Filesystem/AbstractFilesystem.php#L191-L196 |
shopware/platform | src/Core/Framework/Filesystem/AbstractFilesystem.php | AbstractFilesystem.deleteDir | public function deleteDir($dirname): bool
{
$dirname = $this->preparePath($dirname);
return $this->filesystem->deleteDir($dirname);
} | php | public function deleteDir($dirname): bool
{
$dirname = $this->preparePath($dirname);
return $this->filesystem->deleteDir($dirname);
} | [
"public",
"function",
"deleteDir",
"(",
"$",
"dirname",
")",
":",
"bool",
"{",
"$",
"dirname",
"=",
"$",
"this",
"->",
"preparePath",
"(",
"$",
"dirname",
")",
";",
"return",
"$",
"this",
"->",
"filesystem",
"->",
"deleteDir",
"(",
"$",
"dirname",
")",... | {@inheritdoc} | [
"{"
] | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Framework/Filesystem/AbstractFilesystem.php#L201-L206 |
shopware/platform | src/Core/Framework/Filesystem/AbstractFilesystem.php | AbstractFilesystem.createDir | public function createDir($dirname, array $config = []): bool
{
$dirname = $this->preparePath($dirname);
return $this->filesystem->createDir($dirname, $config);
} | php | public function createDir($dirname, array $config = []): bool
{
$dirname = $this->preparePath($dirname);
return $this->filesystem->createDir($dirname, $config);
} | [
"public",
"function",
"createDir",
"(",
"$",
"dirname",
",",
"array",
"$",
"config",
"=",
"[",
"]",
")",
":",
"bool",
"{",
"$",
"dirname",
"=",
"$",
"this",
"->",
"preparePath",
"(",
"$",
"dirname",
")",
";",
"return",
"$",
"this",
"->",
"filesystem"... | {@inheritdoc} | [
"{"
] | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Framework/Filesystem/AbstractFilesystem.php#L211-L216 |
shopware/platform | src/Core/Framework/Filesystem/AbstractFilesystem.php | AbstractFilesystem.setVisibility | public function setVisibility($path, $visibility): bool
{
$path = $this->preparePath($path);
return $this->filesystem->setVisibility($path, $visibility);
} | php | public function setVisibility($path, $visibility): bool
{
$path = $this->preparePath($path);
return $this->filesystem->setVisibility($path, $visibility);
} | [
"public",
"function",
"setVisibility",
"(",
"$",
"path",
",",
"$",
"visibility",
")",
":",
"bool",
"{",
"$",
"path",
"=",
"$",
"this",
"->",
"preparePath",
"(",
"$",
"path",
")",
";",
"return",
"$",
"this",
"->",
"filesystem",
"->",
"setVisibility",
"(... | {@inheritdoc} | [
"{"
] | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Framework/Filesystem/AbstractFilesystem.php#L221-L226 |
shopware/platform | src/Core/Framework/Filesystem/AbstractFilesystem.php | AbstractFilesystem.put | public function put($path, $contents, array $config = []): bool
{
$path = $this->preparePath($path);
return $this->filesystem->put($path, $contents, $config);
} | php | public function put($path, $contents, array $config = []): bool
{
$path = $this->preparePath($path);
return $this->filesystem->put($path, $contents, $config);
} | [
"public",
"function",
"put",
"(",
"$",
"path",
",",
"$",
"contents",
",",
"array",
"$",
"config",
"=",
"[",
"]",
")",
":",
"bool",
"{",
"$",
"path",
"=",
"$",
"this",
"->",
"preparePath",
"(",
"$",
"path",
")",
";",
"return",
"$",
"this",
"->",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Framework/Filesystem/AbstractFilesystem.php#L231-L236 |
shopware/platform | src/Core/Framework/Filesystem/AbstractFilesystem.php | AbstractFilesystem.putStream | public function putStream($path, $resource, array $config = []): bool
{
$path = $this->preparePath($path);
return $this->filesystem->putStream($path, $resource, $config);
} | php | public function putStream($path, $resource, array $config = []): bool
{
$path = $this->preparePath($path);
return $this->filesystem->putStream($path, $resource, $config);
} | [
"public",
"function",
"putStream",
"(",
"$",
"path",
",",
"$",
"resource",
",",
"array",
"$",
"config",
"=",
"[",
"]",
")",
":",
"bool",
"{",
"$",
"path",
"=",
"$",
"this",
"->",
"preparePath",
"(",
"$",
"path",
")",
";",
"return",
"$",
"this",
"... | {@inheritdoc} | [
"{"
] | train | https://github.com/shopware/platform/blob/d8668dda2bd6c830012805ba9c3772349c7debce/src/Core/Framework/Filesystem/AbstractFilesystem.php#L241-L246 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.