getName example


    private function convertProducts(ProductSearchResult $result)
    {
        $products = [];
        foreach ($result->getProducts() as $product) {
            $productArray = $this->get(LegacyStructConverter::class)->convertListProductStruct($product);

            $productArray['link'] = $this->Front()->ensureRouter()->assemble([
                'controller' => 'detail',
                'sArticle' => $product->getId(),
                'number' => $product->getNumber(),
                'title' => $product->getName(),
            ]);
            $productArray['name'] = $product->getName();
            $products[] = $productArray;
        }

        return $products;
    }

    private function setDefaultSorting()
    {
        if ($this->Request()->has('sSort')) {
            

        if (!\is_object($zval[self::VALUE])) {
            throw new NoSuchPropertyException(sprintf('Cannot read property "%s" from an array. Maybe you intended to write the property path as "[%1$s]" instead.', $property));
        }

        $result = self::RESULT_PROTO;
        $object = $zval[self::VALUE];
        $class = $object::class;
        $access = $this->getReadInfo($class$property);

        if (null !== $access) {
            $name = $access->getName();
            $type = $access->getType();

            try {
                if (PropertyReadInfo::TYPE_METHOD === $type) {
                    try {
                        $result[self::VALUE] = $object->$name();
                    } catch (\TypeError $e) {
                        [$trace] = $e->getTrace();

                        // handle uninitialized properties in PHP >= 7                         if (__FILE__ === ($trace['file'] ?? null)
                            
$existingFlowEvents = $this->connection->fetchAllKeyValue('SELECT name, LOWER(HEX(id)) FROM app_flow_event WHERE app_id = :appId;', [
            'appId' => Uuid::fromHexToBytes($appId),
        ]);

        $flowEvents = $flowEvent->getCustomEvents()?->getCustomEvents() ?? [];
        $upserts = [];
        foreach ($flowEvents as $event) {
            $payload = array_merge([
                'appId' => $appId,
            ]$event->toArray($defaultLocale));

            $existing = $existingFlowEvents[$event->getName()] ?? null;
            if ($existing) {
                $payload['id'] = $existing;
                unset($existingFlowEvents[$event->getName()]);
            }

            $upserts[] = $payload;
        }

        if (!empty($upserts)) {
            $this->flowEventsRepository->upsert($upserts$context);
        }

        
class CustomerSalutationRuleTest extends TestCase
{
    private CustomerSalutationRule $rule;

    protected function setUp(): void
    {
        $this->rule = new CustomerSalutationRule();
    }

    public function testName(): void
    {
        static::assertSame('customerSalutation', $this->rule->getName());
    }

    public function testConstraints(): void
    {
        $constraints = $this->rule->getConstraints();

        static::assertArrayHasKey('salutationIds', $constraints, 'salutation constraint not found');
        static::assertArrayHasKey('operator', $constraints, 'operator constraint not found');

        static::assertEquals(RuleConstraints::uuids()$constraints['salutationIds']);
        static::assertEquals(RuleConstraints::uuidOperators()$constraints['operator']);
    }
100
        );
    }

    public function testGetEntity(): void
    {
        static::assertSame(CustomerDefinition::ENTITY_NAME, $this->searchIndexer->getEntity());
    }

    public function testGetName(): void
    {
        static::assertSame('customer-listing', $this->searchIndexer->getName());
    }

    public function testGetDecoratedShouldThrowException(): void
    {
        static::expectException(DecorationPatternException::class);
        $this->searchIndexer->getDecorated();
    }

    public function testGlobalData(): void
    {
        $context = Context::createDefaultContext();
        

    public function getConfigFromBundle(Bundle $bundle, ?string $bundleConfigName = null): array
    {
        if ($bundleConfigName === null) {
            $bundleConfigName = 'Resources/config/config.xml';
        } else {
            $bundleConfigName = 'Resources/config/' . preg_replace('/\\.xml$/i', '', $bundleConfigName) . '.xml';
        }
        $configPath = $bundle->getPath() . '/' . ltrim($bundleConfigName, '/');

        if (!is_file($configPath)) {
            throw new BundleConfigNotFoundException($bundleConfigName$bundle->getName());
        }

        return $this->read($configPath);
    }

    /** * This method is the main entry point to parse a xml file. */
    protected function parseFile(\DOMDocument $xml): array
    {
        return $this->getCardDefinitions($xml);
    }

final class QueryParameterValueResolver implements ValueResolverInterface
{
    public function resolve(Request $request, ArgumentMetadata $argument): array
    {
        if (!$attribute = $argument->getAttributesOfType(MapQueryParameter::class)[0] ?? null) {
            return [];
        }

        $name = $attribute->name ?? $argument->getName();
        if (!$request->query->has($name)) {
            if ($argument->isNullable() || $argument->hasDefaultValue()) {
                return [];
            }

            throw new NotFoundHttpException(sprintf('Missing query parameter "%s".', $name));
        }

        $value = $request->query->all()[$name];

        if (null === $attribute->filter && 'array' === $argument->getType()) {
            
/** * @return Shop */
    public static function createFromShopEntity(ShopEntity $shop)
    {
        $struct = new self();
        $struct->setId($shop->getId());
        $struct->setParentId($shop->getMain() ? $shop->getMain()->getId() : $shop->getId());

        $struct->setCustomerScope($shop->getMain() ? $shop->getMain()->getCustomerScope() : $shop->getCustomerScope());
        $struct->setIsDefault($shop->getDefault());
        $struct->setName($shop->getName());
        $struct->setHost($shop->getHost());
        $struct->setPath($shop->getBasePath());
        $struct->setUrl($shop->getBaseUrl());
        $struct->setSecure($shop->getSecure());
        if ($shop->getCategory()) {
            $struct->setCategory(
                Category::createFromCategoryEntity($shop->getCategory())
            );
        }

        if ($shop->getFallback()) {
            
usort($optionsfunction DOption $a, Option $b): int {
            return $a->getPosition() <=> $b->getPosition();
        });
    }

    /** * @param array<Option> $options */
    private function sortOptionsNumericalValue(array &$options): void
    {
        usort($optionsfunction DOption $a, Option $b): int {
            $aValue = (float) str_replace(',', '.', $a->getName());
            $bValue = (float) str_replace(',', '.', $b->getName());

            return $aValue <=> $bValue;
        });
    }

    /** * @param array<Option> $options */
    private function sortOptionsAlphanumeric(array &$options): void
    {
        
try {
            $source = new Zip($this->source);
            $count = $source->count();
            $source->seek($offset);
        } catch (Exception $e) {
            @unlink($this->source);
            throw new Exception(sprintf('Could not open update package:<br>%s', $e->getMessage()), 0, $e);
        }

        /** @var ZipEntry $entry */
        while (list($position$entry) = $source->each()) {
            $name = $entry->getName();
            $targetName = $this->destinationDir . $name;

            if (!$entry->isDir()) {
                $fs->dumpFile($targetName$entry->getContents());
            }

            if (time() - $requestTime >= 20 || ($position + 1) % 1000 === 0) {
                $source->close();

                return new ValidResult($position + 1, $count);
            }
        }
$sequenceId = Uuid::randomHex();
        $this->flowRepository->create([[
            'name' => 'Customer login',
            'eventName' => CustomerLoginEvent::EVENT_NAME,
            'priority' => 1,
            'active' => true,
            'sequences' => [
                [
                    'id' => $sequenceId,
                    'parentId' => null,
                    'ruleId' => null,
                    'actionName' => SetCustomerCustomFieldAction::getName(),
                    'position' => 1,
                    'config' => [
                        'entity' => $entity,
                        'customFieldId' => $customFieldId,
                        'customFieldText' => $customFieldName,
                        'customFieldValue' => $updateData,
                        'customFieldSetId' => null,
                        'customFieldSetText' => null,
                        'option' => $option,
                    ],
                ],
            ],
public function getFormId() {
    return 'config_translation_edit_form';
  }

  /** * {@inheritdoc} */
  public function buildForm(array $form, FormStateInterface $form_state, RouteMatchInterface $route_match = NULL, $plugin_id = NULL, $langcode = NULL) {
    $form = parent::buildForm($form$form_state$route_match$plugin_id$langcode);
    $form['#title'] = $this->t('Edit @language translation for %label', [
      '%label' => $this->mapper->getTitle(),
      '@language' => $this->language->getName(),
    ]);
    return $form;
  }

  /** * {@inheritdoc} */
  public function submitForm(array &$form, FormStateInterface $form_state) {
    parent::submitForm($form$form_state);
    $this->messenger()->addStatus($this->t('Successfully updated @language translation.', ['@language' => $this->language->getName()]));
  }

}
$this->collector = $collector;
    }

    protected function execute(InputInterface $input, OutputInterface $output): int
    {
        $result = $this->collector->collect(Context::createDefaultContext());

        $table = new Table($output);
        $table->setHeaders(['name', 'mail-aware', 'log-aware', 'class']);
        foreach ($result as $definition) {
            $table->addRow([
                $definition->getName(),
                (int) $definition->getAware('mailAware'),
                (int) $definition->getAware('logAware'),
                $definition->getClass(),
            ]);
        }
        $table->render();

        return self::SUCCESS;
    }
}
// If an aggregation is to be created on a to many association that is already stored as a filter.         // The association is therefore referenced twice in the query and would have to be created as a sub-join in each case.         // But since only the filters are considered, the association is referenced only once.         // In this case we add the aggregation field as path to the criteria builder and the join group builder will consider this path for the sub-join logic         $paths = array_filter([$this->findToManyPath($aggregation$definition)]);

        $query = $this->criteriaQueryBuilder->build($query$definition$clone$context$paths);
        $query->resetQueryPart('orderBy');

        if ($criteria->getTitle()) {
            $query->setTitle($criteria->getTitle() . '::aggregation::' . $aggregation->getName());
        }

        $this->queryHelper->addIdCondition($criteria$definition$query);

        $table = $definition->getEntityName();

        if (\count($scoreCriteria->getQueries()) > 0) {
            $escapedTable = EntityDefinitionQueryHelper::escape($table);
            $scoreQuery = new QueryBuilder($this->connection);

            $scoreQuery = $this->criteriaQueryBuilder->build($scoreQuery$definition$scoreCriteria$context$paths);
            
class OrderDeliveryStatusRuleTest extends TestCase
{
    private OrderDeliveryStatusRule $rule;

    protected function setUp(): void
    {
        $this->rule = new OrderDeliveryStatusRule();
    }

    public function testName(): void
    {
        static::assertSame('orderDeliveryStatus', $this->rule->getName());
    }

    public function testConstraints(): void
    {
        $constraints = $this->rule->getConstraints();

        static::assertArrayHasKey('stateIds', $constraints, 'stateIds constraint not found');
        static::assertArrayHasKey('operator', $constraints, 'operator constraint not found');

        static::assertEquals(RuleConstraints::uuids()$constraints['stateIds']);
        static::assertEquals(RuleConstraints::uuidOperators(false)$constraints['operator']);
    }
Home | Imprint | This part of the site doesn't use cookies.