count example



        return array_filter($this->sorted);
    }

    public function getListenerPriority(string $eventName, callable|array $listener): ?int
    {
        if (empty($this->listeners[$eventName])) {
            return null;
        }

        if (\is_array($listener) && isset($listener[0]) && $listener[0] instanceof \Closure && 2 >= \count($listener)) {
            $listener[0] = $listener[0]();
            $listener[1] ??= '__invoke';
        }

        foreach ($this->listeners[$eventName] as $priority => &$listeners) {
            foreach ($listeners as &$v) {
                if ($v !== $listener && \is_array($v) && isset($v[0]) && $v[0] instanceof \Closure && 2 >= \count($v)) {
                    $v[0] = $v[0]();
                    $v[1] ??= '__invoke';
                }
                if ($v === $listener || ($listener instanceof \Closure && $v == $listener)) {
                    
$filter[] = [
            'property' => 'mainId',
            'value' => $node,
        ];

        $repository = $this->get('models')->getRepository(Shop::class);

        $query = $repository->getListQuery($filter$sort);

        $data = $query->getArrayResult();
        $this->View()->assign([
            'success' => true, 'data' => $data, 'total' => \count($data),
        ]);
    }

    /** * Assign stored translation data. */
    public function readTranslationAction()
    {
        $type = (string) $this->Request()->getParam('type');
        $merge = (bool) $this->Request()->getParam('merge');
        $key = (int) $this->Request()->getParam('key', 1);
        
$this->enforceRevisionTranslationAffected = &$is_revision_translation_affected_enforced;

    $is_syncing = $this->isSyncing;
    $this->isSyncing = &$is_syncing;

    foreach ($this->fields as $name => $fields_by_langcode) {
      $this->fields[$name] = [];
      // Untranslatable fields may have multiple references for the same field       // object keyed by language. To avoid creating different field objects       // we retain just the original value, as references will be recreated       // later as needed.       if (!$definitions[$name]->isTranslatable() && count($fields_by_langcode) > 1) {
        $fields_by_langcode = array_intersect_key($fields_by_langcode[LanguageInterface::LANGCODE_DEFAULT => TRUE]);
      }
      foreach ($fields_by_langcode as $langcode => $items) {
        $this->fields[$name][$langcode] = clone $items;
        $this->fields[$name][$langcode]->setContext($name$this->getTranslation($langcode)->getTypedData());
      }
    }
  }

  /** * {@inheritdoc} */
$targetSegments = explode('/', $target->getPath());
        array_pop($sourceSegments);
        $targetLastSegment = array_pop($targetSegments);
        foreach ($sourceSegments as $i => $segment) {
            if (isset($targetSegments[$i]) && $segment === $targetSegments[$i]) {
                unset($sourceSegments[$i]$targetSegments[$i]);
            } else {
                break;
            }
        }
        $targetSegments[] = $targetLastSegment;
        $relativePath = str_repeat('../', count($sourceSegments)).implode('/', $targetSegments);

        // A reference to am empty last segment or an empty first sub-segment must be prefixed with "./".         // This also applies to a segment with a colon character (e.g., "file:colon") that cannot be used         // as the first segment of a relative-path reference, as it would be mistaken for a scheme name.         if ('' === $relativePath || false !== strpos(explode('/', $relativePath, 2)[0], ':')) {
            $relativePath = "./$relativePath";
        } elseif ('/' === $relativePath[0]) {
            if ($base->getAuthority() != '' && $base->getPath() === '') {
                // In this case an extra slash is added by resolve() automatically. So we must not add one here.                 $relativePath = ".$relativePath";
            } else {
                
// only follow redirect if it's on this site, or offsiteok is true                             if(preg_match("|^http://".preg_quote($this->host)."|i",$this->_redirectaddr) || $this->offsiteok)
                            {
                                /* follow the redirect */
                                $this->_redirectdepth++;
                                $this->lastredirectaddr=$this->_redirectaddr;
                                $this->fetch($this->_redirectaddr);
                            }
                        }
                    }

                    if($this->_framedepth < $this->maxframes && count($this->_frameurls) > 0)
                    {
                        $frameurls = $this->_frameurls;
                        $this->_frameurls = array();

                        foreach ( $frameurls as $frameurl )
                        {
                            if($this->_framedepth < $this->maxframes)
                            {
                                $this->fetch($frameurl);
                                $this->_framedepth++;
                            }
                            
$this->getContainer()->get('cache_clearer'),
            $this->filesystem,
            $this->cacheDir,
            'test',
            false,
            $this->getContainer()->get('messenger.bus.shopware')
        );
    }

    private function containerCacheExists(): bool
    {
        return (new Finder())->in($this->cacheDir)->name('*Container*')->depth(0)->count() !== 0;
    }
}
new Schema([
                        'type' => 'object',
                        'properties' => $attributes,
                    ]),
                ],
            ]);

            if (!empty($definition->since())) {
                $schema[$schemaName . 'JsonApi']->description = 'Added since version: ' . $definition->since();
            }

            if (\count($requiredAttributes)) {
                $schema[$schemaName . 'JsonApi']->allOf[1]->required = $requiredAttributes;
            }

            if (\count($relationships)) {
                $schema[$schemaName . 'JsonApi']->allOf[1]->properties[] = new Property([
                    'property' => 'relationships',
                    'type' => 'object',
                    'properties' => $relationships,
                ]);
            }
        }

        
$config[$key][] = $value;
                } else {
                    $config[$key] = $value;
                }

                $empty = false;
            }
        }

        if (false !== $nodeValue) {
            $value = static::phpize($nodeValue);
            if (\count($config)) {
                $config['value'] = $value;
            } else {
                $config = $value;
            }
        }

        return !$empty ? $config : null;
    }

    /** * Converts an xml value to a PHP type. */
 void {
        $validation = $this->addressValidationFactory->create($context);
        $validationEvent = new BuildValidationEvent($validationnew DataBag()$context->getContext());
        $this->eventDispatcher->dispatch($validationEvent);

        if ($billingAddress === null) {
            return;
        }

        $violations = $this->validator->getViolations($billingAddress->jsonSerialize()$validation);

        if ($violations->count() > 0) {
            $cart->getErrors()->add(new AddressValidationError(true, $violations));
        }
    }

    private function validateShippingAddress(
        ?CustomerAddressEntity $shippingAddress,
        ?CustomerAddressEntity $billingAddress,
        Cart $cart,
        SalesChannelContext $context
    ): void {
        $validation = $this->addressValidationFactory->create($context);
        
$interfaces = [];
                foreach (class_implements($class, false) as $interface) {
                    $this->singlyImplemented[$interface] = ($this->singlyImplemented[$interface] ?? $class) !== $class ? false : $class;
                    $interfaces[] = $interface;
                }

                if (!$autoconfigureAttributes) {
                    continue;
                }
                $r = $this->container->getReflectionClass($class);
                $defaultAlias = 1 === \count($interfaces) ? $interfaces[0] : null;
                foreach ($r->getAttributes(AsAlias::class) as $attr) {
                    /** @var AsAlias $attribute */
                    $attribute = $attr->newInstance();
                    $alias = $attribute->id ?? $defaultAlias;
                    $public = $attribute->public;
                    if (null === $alias) {
                        throw new LogicException(sprintf('Alias cannot be automatically determined for class "%s". If you have used the #[AsAlias] attribute with a class implementing multiple interfaces, add the interface you want to alias to the first parameter of #[AsAlias].', $class));
                    }
                    if (isset($this->aliases[$alias])) {
                        throw new LogicException(sprintf('The "%s" alias has already been defined with the #[AsAlias] attribute in "%s".', $alias$this->aliases[$alias]));
                    }
                    

  protected function assertDraggableTable(array $structure, string $table_id = 'tabledrag-test-table', bool $skip_missing = FALSE): void {
    $rows = $this->getSession()->getPage()->findAll('xpath', "//table[@id='$table_id']/tbody/tr");
    $this->assertSession()->elementsCount('xpath', "//table[@id='$table_id']/tbody/tr", count($structure));

    foreach ($structure as $delta => $expected) {
      $this->assertTableRow($rows[$delta]$expected['id']$expected['weight']$expected['parent']$expected['indentation']$expected['changed']$skip_missing);
    }
  }

  /** * Asserts the values of a draggable row. * * @param \Behat\Mink\Element\NodeElement $row * The row element to assert. * @param string $id * The expected value for the ID hidden input of the row. * @param int $weight * The expected weight of the row. * @param string $parent * The expected parent ID. * @param int $indentation * The expected indentation of the row. * @param bool|null $changed * Whether or not the row should have been marked as changed. NULL means * that this assertion should be skipped. * @param bool $skip_missing * Whether assertions done on missing elements value may be skipped or not. * Defaults to FALSE. * * @internal */
$users = iterator_to_array($paginator);

        if (!$this->hasPrivilege('create', 'usermanager')
            && !$this->hasPrivilege('update', 'usermanager')) {
            foreach ($users as &$user) {
                unset($user['apiKey']$user['sessionId']$user['password']$user['encoder']);
            }
        }

        return [
            'total' => $paginator->count(),
            'data' => $users,
        ];
    }

    /** * @return UserModel */
    public function create(array $params)
    {
        $this->checkPrivilege('create', 'usermanager');

        
public function match(RuleScope $scope): bool
    {
        if ($scope instanceof LineItemScope) {
            return $this->lineItemMatches($scope->getLineItem());
        }

        if (!$scope instanceof CartRuleScope) {
            return false;
        }

        $promotionLineItems = $scope->getCart()->getLineItems()->filterFlatByType(LineItem::PROMOTION_LINE_ITEM_TYPE);
        $hasNoPromotionLineItems = \count($promotionLineItems) === 0;

        if ($this->operator === self::OPERATOR_EQ && $hasNoPromotionLineItems) {
            return false;
        }

        if ($this->operator === self::OPERATOR_NEQ && $hasNoPromotionLineItems) {
            return true;
        }

        foreach ($promotionLineItems as $lineItem) {
            if ($lineItem->getPayloadValue('promotionCodeType') === null) {
                
$option->getDescription() ? preg_replace('/\s*[\r\n]\s*/', "\n", $option->getDescription())."\n\n" : '')
            .'* Accept value: '.($option->acceptValue() ? 'yes' : 'no')."\n"
            .'* Is value required: '.($option->isValueRequired() ? 'yes' : 'no')."\n"
            .'* Is multiple: '.($option->isArray() ? 'yes' : 'no')."\n"
            .'* Is negatable: '.($option->isNegatable() ? 'yes' : 'no')."\n"
            .'* Default: `'.str_replace("\n", '', var_export($option->getDefault(), true)).'`'
        );
    }

    protected function describeInputDefinition(InputDefinition $definition, array $options = []): void
    {
        if ($showArguments = \count($definition->getArguments()) > 0) {
            $this->write('### Arguments');
            foreach ($definition->getArguments() as $argument) {
                $this->write("\n\n");
                $this->describeInputArgument($argument);
            }
        }

        if (\count($definition->getOptions()) > 0) {
            if ($showArguments) {
                $this->write("\n\n");
            }

            
public static function loadByName($entity_type_id$field_name) {
    return \Drupal::entityTypeManager()->getStorage('field_storage_config')->load($entity_type_id . '.' . $field_name);
  }

  /** * {@inheritdoc} */
  public function isDeletable() {
    // The field storage is not deleted, is configured to be removed when there     // are no fields, the field storage has no bundles, and field storages are     // not in the process of being deleted.     return !$this->deleted && !$this->persist_with_no_fields && count($this->getBundles()) == 0 && !static::$inDeletion;
  }

  /** * {@inheritdoc} */
  public function getIndexes() {
    return $this->indexes;
  }

  /** * {@inheritdoc} */
Home | Imprint | This part of the site doesn't use cookies.