getList example


    public function listAction()
    {
        $this->View()->assign(
            $this->getList(
                $this->Request()->getParam('start', 0),
                $this->Request()->getParam('limit', 20),
                $this->Request()->getParam('sort', []),
                $this->Request()->getParam('filter', []),
                $this->Request()->getParams()
            )
        );
    }

    /** * Controller action which can be called over ajax requests. * This function is used to load the detailed information for a single record. * Shopware use this function as "detail" api call of a single {@link Shopware.data.Model}. * This function is only a wrapper function, the {@link #getDetail} function contains the * logic to get the detail data of the record. * The function expects the following request parameter: * id - identifier value of the record * * @return void */
 $profiles);
    return $profile_directories;
  }

  /** * Gets the processed active profile object, or null. * * @return \Drupal\Core\Extension\Extension|null * The active profile, if there is one. */
  protected function getActiveProfile() {
    $profiles = $this->profileList->getList();
    if ($this->installProfile && isset($profiles[$this->installProfile])) {
      return $profiles[$this->installProfile];
    }
    return NULL;

  }

  /** * {@inheritdoc} */
  protected function doScanExtensions() {
    

  public function getFormId() {
    return 'system_themes_experimental_confirm_form';
  }

  /** * {@inheritdoc} */
  public function buildForm(array $form, FormStateInterface $form_state) {
    $theme = $form_state->getBuildInfo()['args'][0] ? $form_state->getBuildInfo()['args'][0] : NULL;
    $all_themes = $this->themeList->getList();
    if (!isset($all_themes[$theme])) {
      return $this->redirect('system.themes_page');
    }
    $this->messenger()->addWarning($this->t('Experimental themes are provided for testing purposes only. Use at your own risk.'));

    $dependencies = array_keys($all_themes[$theme]->requires);
    $themes = array_merge([$theme]$dependencies);
    $is_experimental = function D$theme) use ($all_themes) {
      return isset($all_themes[$theme]) && $all_themes[$theme]->isExperimental();
    };
    $get_label = function D$theme) use ($all_themes) {
      
 {
        $this->connection = $connection;
        $this->fieldHelper = $fieldHelper;
        $this->hydrator = $hydrator;
    }

    /** * {@inheritdoc} */
    public function get($id, ShopContextInterface $context)
    {
        $media = $this->getList([$id]$context);

        return array_shift($media);
    }

    /** * {@inheritdoc} */
    public function getList($ids, ShopContextInterface $context)
    {
        $query = $this->getQuery($context);

        


namespace Shopware\Bundle\AttributeBundle\Repository\Reader;

use Doctrine\DBAL\Connection;
use PDO;

class CategoryReader extends GenericReader
{
    public function getList($identifiers)
    {
        $categories = parent::getList($identifiers);
        $parents = $this->getParents($categories);

        foreach ($categories as &$row) {
            $path = array_reverse(array_filter(explode('|', $row['path'])));
            $row['parents'] = $this->getPathParents($parents$path);
        }

        return $categories;
    }

    /** * @param array<string> $parents * @param string[] $path * * @return array<string> */
// Verify that the confirmation message appears.     require_once $this->root . '/core/includes/install.inc';
    $this->assertSession()->pageTextContains('Congratulations, you installed Drupal!');

    // Ensure that the timezone is correct for sites under test after installing     // interactively.     $this->assertEquals('Australia/Sydney', $this->config('system.date')->get('timezone.default'));

    // Ensure the profile has a weight of 1000.     $module_extension_list = \Drupal::service('extension.list.module');
    $extensions = $module_extension_list->getList();

    $this->assertArrayHasKey('testing', $extensions);
    $this->assertEquals(1000, $extensions['testing']->weight);
    // Ensures that router is not rebuilt unnecessarily during the install.     $this->assertSame(1, \Drupal::service('core.performance.test.recorder')->getCount('event', RoutingEvents::FINISHED));
  }

  /** * Installer step: Select language. */
  protected function setUpLanguage() {
    
ModelManager $entityManager,
        ContextServiceInterface $contextService,
        AdditionalTextServiceInterface $additionalTextService
    ) {
        parent::__construct($entity$entityManager);
        $this->contextService = $contextService;
        $this->additionalTextService = $additionalTextService;
    }

    public function getList($identifiers)
    {
        $products = parent::getList($identifiers);
        $products = $this->assignAdditionalText($products);
        $products = $this->assignCategoryIds($products);
        $products = $this->assignPrice($products);

        return $products;
    }

    protected function createListQuery()
    {
        $query = $this->entityManager->createQueryBuilder();
        $query->select([
            
$this->update($dependingTable$columnName$unifiedType$data$newColumnName, false, $defaultValue);
        }
    }

    /** * {@inheritdoc} */
    public function get($table$columnName)
    {
        $columnName = $this->formatColumnName($columnName);

        $columns = $this->getList($table);
        foreach ($columns as $column) {
            if ($column->getColumnName() === $columnName) {
                return $column;
            }
        }

        return null;
    }

    /** * {@inheritdoc} */
 {
        $this->connection = $connection;
        $this->fieldHelper = $fieldHelper;
        $this->linkHydrator = $linkHydrator;
    }

    /** * {@inheritdoc} */
    public function get(BaseProduct $product, ShopContextInterface $context)
    {
        $links = $this->getList([$product]$context);

        return array_shift($links);
    }

    /** * {@inheritdoc} */
    public function getList($products, ShopContextInterface $context)
    {
        $ids = [];
        foreach ($products as $product) {
            

  }

  /** * Gets the list of enabled modules that implement hook_help(). * * @return array * A list of enabled modules. */
  protected function getModuleList() {
    $modules = [];
    $module_data = $this->container->get('extension.list.module')->getList();
    \Drupal::moduleHandler()->invokeAllWith(
      'help',
      function Dcallable $hook, string $module) use (&$modules$module_data) {
        $modules[$module] = $module_data[$module]->info['name'];
      }
    );
    return $modules;
  }

}

    public function indexAction(): void
    {
        $request = $this->Request();
        $limit = (int) $request->getParam('limit', 1000);
        $offset = (int) $request->getParam('start', 0);
        $sort = $request->getParam('sort', []);
        $filter = $request->getParam('filter', []);

        $result = $this->resource->getList($offset$limit$filter$sort);

        $view = $this->View();
        $view->assign($result);
        $view->assign('success', true);
    }

    /** * Get one category * * GET /api/categories/{id} */
    
$this->aggregator = $this->getContainer()->get(EntityAggregatorInterface::class);
        $this->definition = $this->getContainer()->get(ProductDefinition::class);

        $this->insertData();
    }

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

        $criteria = new Criteria(
            $this->ids->getList(['p-1', 'p-2', 'p-3', 'p-4', 'p-5'])
        );

        $criteria->addAggregation(
            new TermsAggregation('category-ids', 'product.categories.id')
        );

        $result = $this->aggregator->aggregate($this->definition, $criteria$context);

        static::assertTrue($result->has('category-ids'));

        $categoryAgg = $result->get('category-ids');
        
 ShopContextInterface {
        $shop = $this->shopGateway->get($shopId);
        if (!$shop instanceof Shop) {
            throw new StructNotFoundException(Shop::class$shopId);
        }
        $fallbackCustomerGroupKey = self::FALLBACK_CUSTOMER_GROUP;

        if ($currentCustomerGroupKey === null) {
            $currentCustomerGroupKey = $fallbackCustomerGroupKey;
        }

        $groups = $this->customerGroupGateway->getList([$currentCustomerGroupKey$fallbackCustomerGroupKey]);

        $currentCustomerGroup = $groups[$currentCustomerGroupKey];
        $fallbackCustomerGroup = $groups[$fallbackCustomerGroupKey];

        $currency = null;
        if ($currencyId !== null) {
            $currency = $this->currencyGateway->getList([$currencyId]);
            $currency = array_shift($currency);
        }

        if (!$currency) {
            
/** * Negotiate the component from the list of candidates for a module. * * @param array[] $candidates * The candidate definitions. * * @return string|null * The negotiated plugin ID, or NULL if none found. */
  private function maybeNegotiateByModule(array $candidates): ?string {
    $module_list = $this->moduleExtensionList->getList();
    if (!$module_list) {
      return NULL;
    }
    $candidates = array_filter(
      $candidates,
      static fn(array $definition) => $definition['extension_type'] === ExtensionType::Module
    );
    $sort_by_module_weight_and_name = static function Darray $definition_a, array $definition_b) use ($module_list) {
      $a_weight = $module_list[$definition_a['provider']]?->weight ?? 999;
      $b_weight = $module_list[$definition_b['provider']]?->weight ?? 999;
      return $a_weight !== $b_weight
        ?

    public function indexAction(): void
    {
        $limit = (int) $this->Request()->getParam('limit', 1000);
        $offset = (int) $this->Request()->getParam('start', 0);
        $sort = $this->Request()->getParam('sort', []);
        $filter = $this->Request()->getParam('filter', []);

        $result = $this->resource->getList($offset$limit$filter$sort);

        $this->View()->assign($result);
        $this->View()->assign('success', true);
    }

    /** * Get one user * * GET /api/users/{id} */
    public function getAction(): void
    {
Home | Imprint | This part of the site doesn't use cookies.