Returns the stock items for the given codes and types

@param array $codes List of stock codes
@param array $types List of stock types
@return array Multi-dimensional array of code/type/item map
420360
protected function getStockItems( array $codes, array $types )
	{
		$map = [];
		$manager = \Aimeos\MShop::create( $this->getContext(), 'stock' );

		$search = $manager->createSearch()->setSlice( 0, 10000 );
		$search->setConditions( $search->combine( '&&', [
			$search->compare( '==', 'stock.productcode', $codes ),
			$search->compare( '==', 'stock.type', $types )
		] ) );

		foreach( $manager->searchItems( $search ) as $item ) {
			$map[$item->getProductCode()][$item->getType()] = $item;
		}

		return $map;
	}
1316652
public static function guessClassFromTypes(array $types)
    {
        if (count($types)) {
            foreach (Resource::CLASSES as $class) {
                $class = "JSKOS\\$class";
                foreach ($class::TYPES as $uri) {
                    if (in_array($uri, $types)) {
                        return $class;
                    }
                }
            }
        }
    }
1124377
public static function get_groups_by_permission($codes)
    {
        $codeParams = is_array($codes) ? $codes : array($codes);
        $codeClause = DB::placeholders($codeParams);

        // Via Roles are groups that have the permission via a role
        /** @skipUpgrade */
        return Group::get()
            ->where(array(
                "\"PermissionRoleCode\".\"Code\" IN ($codeClause) OR \"Permission\".\"Code\" IN ($codeClause)"
                => array_merge($codeParams, $codeParams)
            ))
            ->leftJoin('Permission', "\"Permission\".\"GroupID\" = \"Group\".\"ID\"")
            ->leftJoin('Group_Roles', "\"Group_Roles\".\"GroupID\" = \"Group\".\"ID\"")
            ->leftJoin('PermissionRole', "\"Group_Roles\".\"PermissionRoleID\" = \"PermissionRole\".\"ID\"")
            ->leftJoin('PermissionRoleCode', "\"PermissionRoleCode\".\"RoleID\" = \"PermissionRole\".\"ID\"");
    }
206635
protected function getProducts( array $codes, array $domains )
	{
		$result = [];
		$manager = \Aimeos\MShop::create( $this->getContext(), 'product' );

		$search = $manager->createSearch();
		$search->setConditions( $search->compare( '==', 'product.code', $codes ) );
		$search->setSlice( 0, count( $codes ) );

		foreach( $manager->searchItems( $search, $domains ) as $item ) {
			$result[$item->getCode()] = $item;
		}

		return $result;
	}
1006603
public function lookUp(array $types)
    {
        while ($this->hasTokens()) {
            $token = $this->getToken();
            if (!in_array(get_class($token), $types, true)) {
                break;
            }

            yield $token;

            $this->nextToken();
        }
    }
513390
private function doWarm(array $types)
    {
        $warmed = [];
        $this->doClear($types);
        foreach ($types as $type) {
            $this->mf->getMetadataForType($type);
            $warmed[] = $type;
        }
        return $warmed;
    }
404348
public function getItemsByTypes(array $types): array
    {
        return array_filter(
            $this->getItems(),
            function (Item $item) use ($types) {
                return in_array(
                    $item->getType(),
                    $types
                );
            }
        );
    }
704602
protected function _getListTypeItem( $code )
	{
		$manager = MShop_Factory::createManager( $this->_getContext(), 'customer/list/type' );

		$search = $manager->createSearch( true );
		$search->setConditions( $search->compare( '==', 'customer.list.type.code', $code ) );
		$result = $manager->searchItems( $search );

		if( ( $item = reset( $result ) ) === false ) {
			throw new Controller_Jobs_Exception( sprintf( 'List type for domain "%1$s" and code "%2$s" not found', 'customer', $code ) );
		}

		return $item;
	}
1049235
protected function matchAny(array $types)
    {
        if ( ! $this->lexer->isNextAny($types)) {
            $this->syntaxError('any of '.implode(' or ', array_map(array($this->lexer, 'getName'), $types)));
        }

        $this->lexer->moveNext();

        return $this->lexer->token[0];
    }
1148264
public static function getCodeByType($type)
    {
        if (isset(self::$typeList[$type])) {
            return self::$typeList[$type];
        } else {
            return false;
        }
    }
515359
public function get( $code, $type = null )
	{
		if( isset( $this->prodmap[$code] ) ) {
			return $this->prodmap[$code];
		}

		$manager = \Aimeos\MShop::create( $this->getContext(), 'product' );

		$search = $manager->createSearch();
		$search->setConditions( $search->compare( '==', 'product.code', $code ) );

		$result = $manager->searchItems( $search );

		if( ( $item = reset( $result ) ) !== false )
		{
			$this->prodmap[$code] = $item->getId();
			return $this->prodmap[$code];
		}
	}
523190
public static function getTypeForCode( $typeCode )
	{
		return isset( XmlTypeCode::$codeToTypeMap[ $typeCode ] )
			? XmlTypeCode::$codeToTypeMap[ $typeCode ]
			: false;
	}
408260
public function lookaheadTypeIsAnyOf(array $types): bool
    {
        return isset($this->tokens[$this->position]) && $this->tokens[$this->position]->typeEqualsAnyOf($types);
    }
11243
protected function codeStr($codes)
    {
        // If we get something that is already a code string, just pass it back
        if (!is_array($codes) && strpos($codes, ';')) {
            return $codes;
        }

        $codes = Helper::toArray($codes);

        // Sort for the sake of consistency and testability
        sort($codes);

        return implode(';', $codes);
    }
1207432
public function filter(array $types = array())
    {
        $this->mergeTypes($types);

        $files = $this->getFiles();

        foreach ($files as $filename) {

            foreach (file($filename) as $lineNumber => $content) {
                foreach ($this->types as $type) {
                    if (stristr($content, "@$type")) {

                        // Strip note type text and comment tag
                        $content = preg_replace("/\S+(\s|\s\s+)$type(\s|\s\s+)/", '', $content);

                        // Strip excess whitespace (space or tab) in beginning string
                        $content = trim(preg_replace('/(\t+|\s\s+)/', '', $content));

                        $this->add(
                            new Line($filename, $lineNumber, $content, $type)
                        );
                    }
                }
            }
        }

        return $this->matches;
    }
590106
public function getData4CodeType($code, $type)
    {
        $query = $this->createQueryBuilder('p')
            ->select('p')
            ->where('p.code = :code')
            ->setParameter('code', $code)
            ->andWhere('p.expire >= :expire')
            ->setParameter('expire', new \DateTime())
            ->andWhere('p.type = :type')
            ->setParameter('type', $type)
            ->getQuery();

        return $query->getOneOrNullResult();
    }
1313583
public function createFromArray(array $types)
    {
        foreach ($types as $type) {
            $this->collection->add(Type::fromString($type));
        }

        return $this->collection;
    }