Constructs the data array for the view from the given item

@param \Aimeos\MShop\Common\Item\Lists\Iface[] $listItems Supplier list items referencing the products
@return string[] Multi-dimensional associative list of item data
961212
protected function toArray( array $listItems )
	{
		$data = [];

		foreach( $listItems as $listItem )
		{
			foreach( $listItem->toArray( true ) as $key => $value ) {
				$data[$key][] = $value;
			}
		}

		return $data;
	}
549043
private function fetchItems($materials)
    {
        $list = [];
        /** @var MaterialInterface $material */
        foreach ($materials as $material) {
            $unitName = null;
            $unit = $material->getUnit();
            if (!is_null($unit)) {
                $unitName = $unit->getName();
            }

            $list[] = new ListMaterialItem(
                $material->getId(),
                $material->getName(),
                $material->getCode(),
                $unitName,
                $material->getCategory()->getName()
            );
        }

        return $list;
    }
68558
protected function fromArray( \Aimeos\MShop\Product\Item\Iface $item, array $data )
	{
		$context = $this->getContext();
		$manager = \Aimeos\MShop::create( $context, 'product' );
		$listManager = \Aimeos\MShop::create( $context, 'product/lists' );

		$prodItem = $manager->createItem()->setType( 'default' );
		$listItem = $listManager->createItem()->setType( 'default' );
		$articles = $item->getRefItems( 'product', null, 'default', false );
		$listItems = $item->getListItems( 'product', 'default', null, false );

		foreach( $data as $idx => $entry )
		{
			if( ( $litem = $item->getListItem( 'product', 'default', $entry['product.id'], false ) ) === null ) {
				$litem = clone $listItem;
			}

			if( isset( $articles[$litem->getRefId()] ) ) {
				$refItem = $articles[$litem->getRefId()];
			} else {
				$refItem = clone $prodItem;
			}

			$litem->fromArray( $entry, true );
			$litem->setPosition( $idx );

			$refItem->fromArray( $entry, true );

			if( isset( $entry['attr'] ) ) {
				$refItem = $this->fromArrayAttributes( $refItem, $entry['attr'] );
			}

			$item->addListItem( 'product', $litem, $refItem );
			unset( $listItems[$litem->getId()] );
		}

		return $item->deleteListItems( $listItems );
	}
727819
public function provide($data = null, array $options = [])
    {
        $result = '';
        $data = (string)$data;

        if ('' === trim($data)) {
            return $result;
        }

        if (empty($options['listItems']) && empty($options['fieldDefinitions'])) {
            throw new InvalidArgumentException("No listItems or fieldDefinitions options provided");
        }

        if (empty($options['listItems'])) {
            $selectListItems = $this->config->getProvider('selectOptions');
            $selectListItems = new $selectListItems($this->config);
            $listName = $options['fieldDefinitions']->getLimit();
            $listOptions = [];

            $options['listItems'] = $selectListItems->provide($listName, $listOptions);
        }

        $listItems = $options['listItems'];

        if (!is_array($options['listItems'])) {
            throw new InvalidArgumentException("List items is not an array");
        }

        if (!isset($listItems[$data])) {
            return sprintf(static::VALUE_NOT_FOUND_HTML, parent::provide($data, $options));
        }

        // Concatenate all parents together with value
        // Nested values are dot-separated.  At least the
        // value itself will be included, if no parents.
        $parents = explode('.', $data);
        $path = '';
        foreach ($parents as $parent) {
            $path = empty($path) ? $parent : $path . '.' . $parent;
            $result .= isset($listItems[$path]) ? $listItems[$path] : '';
        }

        return $result;
    }
445945
protected function getCatalogIdsFromTree( \Aimeos\MShop\Catalog\Item\Iface $item )
	{
		if( $item->getStatus() < 1 ) {
			return [];
		}

		$list = [ $item->getId() ];

		foreach( $item->getChildren() as $child ) {
			$list = array_merge( $list, $this->getCatalogIdsFromTree( $child ) );
		}

		return $list;
	}
15182
protected function toArray( \Aimeos\MShop\Coupon\Item\Iface $item, $copy = false )
	{
		$config = $item->getConfig();
		$data = $item->toArray( true );
		$data['config'] = [];

		if( $copy === true )
		{
			$data['coupon.siteid'] = $this->getContext()->getLocale()->getSiteId();
			$data['coupon.id'] = '';
		}

		ksort( $config );

		foreach( $config as $key => $value )
		{
			$data['config']['key'][] = $key;
			$data['config']['val'][] = $value;
		}

		return $data;
	}
699866
public function GetListSettingAsArray()
    {
        $aSettings = array();
        $iPointer = $this->getItemPointer();
        $this->GoToStart();
        while ($oItem = $this->Next()) {
            $aTmpSetting = $oItem->GetActiveSettingAsArray();
            $aSettings = array_merge_recursive($aSettings, $aTmpSetting);
        }
        $this->setItemPointer($iPointer);

        return $aSettings;
    }
1352669
public function getItemsAsArray()
    {
        $items = [];

        foreach ($this->teasers as $page => $teaser) {
            if ($page == $this->intPage) {
                $items[] = [
                    'page' => $page,
                    'href' => null,
                    'title' => null,
                    'text' => $teaser,
                ];
            } else {
                $items[] = [
                    'page' => $page,
                    'href' => $this->linkToPage($page),
                    'title' => StringUtil::specialchars(sprintf($GLOBALS['TL_LANG']['MSC']['goToPage'], $page)),
                    'text' => $teaser,
                ];
            }
        }

        if ($this->singlePageUrl) {
            $items[] = [
                'page' => 'singlePage',
                'href' => $this->singlePageUrl,
                'title' => null,
                'text' => $GLOBALS['TL_LANG']['MSC']['readOnSinglePage'],
            ];
        }

        return $items;
    }
593947
protected function toArray( \Aimeos\MShop\Common\Item\Type\Iface $item, $copy = false )
	{
		$data = $item->toArray( true );

		if( $copy === true )
		{
			$data['price.lists.type.code'] = $data['price.lists.type.code'] . '_copy';
			$data['price.lists.type.id'] = '';
		}

		return $data;
	}
584759
protected function getGroupItems()
	{
		$list = [];
		$isSuper = $this->getView()->access( ['super'] );
		$isAdmin = $this->getView()->access( ['admin'] );

		$manager = \Aimeos\MShop::create( $this->getContext(), 'customer/group' );
		$search = $manager->createSearch();
		$search->setSortations( [$search->sort( '+', 'customer.group.label' )] );

		foreach( $manager->searchItems( $search ) as $groupId => $groupItem )
		{
			if( !$isSuper && in_array( $groupItem->getCode(), ['super'] ) ) {
				continue;
			}

			if( !$isSuper && !$isAdmin && in_array( $groupItem->getCode(), ['super', 'admin', 'editor'] ) ) {
				continue;
			}

			$list[$groupId] = $groupItem;
		}

		return $list;
	}
1003743
public function process( \Aimeos\MShop\Coupon\Item\Code\Iface $item, array $data )
	{
		$manager = \Aimeos\MShop::create( $this->getContext(), 'coupon/code' );
		$map = $this->getMappedChunk( $data, $this->getMapping() );

		foreach( $map as $list )
		{
			if( trim( $list['coupon.code.code'] ) == '' ) {
				continue;
			}

			$item = $manager->saveItem( $item->fromArray( $list ) );
		}

		return $this->getObject()->process( $item, $data );
	}
501445
protected function toArray( \Aimeos\MShop\Catalog\Item\Iface $item, $copy = false )
	{
		$data = $item->toArray( true );
		$data['config'] = [];

		if( $copy === true )
		{
			$data['catalog.id'] = '';
			$data['catalog.siteid'] = $item->getSiteId();
			$data['catalog.code'] = $data['catalog.code'] . '_copy';
		}

		foreach( $item->getConfig() as $key => $value )
		{
			$data['config']['key'][] = $key;
			$data['config']['val'][] = $value;
		}

		return $data;
	}
194883
protected function toArray( \Aimeos\MShop\Customer\Item\Iface $item, $copy = false )
	{
		$data = $item->toArray( true );

		if( $copy === true )
		{
			$data['customer.siteid'] = $this->getContext()->getLocale()->getSiteId();
			$data['customer.email'] = '';
			$data['customer.id'] = '';
		}

		return $data;
	}
964930
public function mapItems(array $data): array
    {
        $items = [];

        foreach ($data as $dataItem) {
            $items[] = Item::fromArray(
                [
                    'id' => (int) $dataItem['id'],
                    'collectionId' => (int) $dataItem['collection_id'],
                    'position' => (int) $dataItem['position'],
                    'value' => $dataItem['value'],
                    'valueType' => $dataItem['value_type'],
                    'status' => (int) $dataItem['status'],
                    'config' => $this->buildParameters((string) $dataItem['config']),
                ]
            );
        }

        return $items;
    }
504235
protected function fromArray( \Aimeos\MShop\Supplier\Item\Iface $item, array $data )
	{
		$manager = \Aimeos\MShop::create( $this->getContext(), 'supplier/address' );

		$addrItems = $item->getAddressItems();

		foreach( $data as $entry )
		{
			if( isset( $addrItems[$entry['supplier.address.id']] ) )
			{
				$addrItem = $addrItems[$entry['supplier.address.id']];
				unset( $addrItems[$entry['supplier.address.id']] );
			}
			else
			{
				$addrItem = $manager->createItem();
			}

			$addrItem->fromArray( $entry, true );
			$item->addAddressItem( $addrItem );
		}

		$item->deleteAddressItems( $addrItems );
	}
296466
protected static function getListStrategy($listType) {
    // get list strategies
    if (self::$listStrategies == null) {
      self::$listStrategies = ObjectFactory::getInstance('listStrategies');
    }

    $strategy = null;

    // search strategy
    if (isset(self::$listStrategies[$listType])) {
      $strategy = self::$listStrategies[$listType];
    }
    else {
      throw new ConfigurationException('No ListStrategy implementation registered for '.$listType);
    }
    return $strategy;
  }
1292676
public function buildItemActions()
    {
        $create_route = function (EntityInterface $item) {
            return array(
                'path' => 'KunstmaanFormBundle_formsubmissions_list',
                'params' => array('nodeTranslationId' => $item->getId()),
            );
        };
        $ia = new \Kunstmaan\AdminListBundle\AdminList\ItemAction\SimpleItemAction(
            $create_route,
            'eye',
            'View'
        );
        $this->addItemAction($ia);
    }