@param int         $item_id
@param string      $locale
@param string|null $version

@return array
@throws ArgumentException
@throws SettingsException
333028
public static function getStaticItem( int $item_id, string $locale = 'en_US', string $version = null ) : array
	{
		$data = self::getStaticItems($locale, $version);
		if (isset($data['data'][$item_id]) == false)
			throw new ArgumentException('Item with given ID was not found.', 404);

		return $data['data'][$item_id];
	}
794243
public function storeItemVariables($deliveryResultIdentifier, $test, $item, array $itemVariables, $callIdItem)
    {
        $variables = [];

        foreach ($itemVariables as $itemVariable) {
            $variables[] = $this->handleFiles($deliveryResultIdentifier, $itemVariable);
        }

        $this->getDbStorage()->storeItemVariables(
            $deliveryResultIdentifier,
            $test,
            $item,
            $variables,
            $callIdItem
        );
    }
1175013
public static function getStaticItems( string $locale = 'en_US', string $version = null ) : array
	{
		$url = self::getStaticDataFileUrl(self::STATIC_ITEMS, null, $locale, $version);
		return self::loadStaticData($url);
	}
291409
public function getStaticItems( string $locale = 'en_US', string $version = null ): StaticData\StaticItemListDto
	{
		$result = false;
		try
		{
			// Fetch StaticData from JSON files
			$result = DataDragonAPI::getStaticItems($locale, $version);
			if (!$result) throw new ServerException("StaticData failed to be loaded.");

			// Create missing data
			array_walk($result['data'], function (&$d, $k) {
				$d['id'] = $k;
			});

			$this->result_data = $result;
		}
		catch (DataDragonExceptions\SettingsException $ex)
		{
			throw new SettingsException("DataDragon API was not initialized properly! StaticData endpoints cannot be used.");
		}
		catch (DataDragonExceptions\ArgumentException $ex)
		{
			throw new RequestException($ex->getMessage(), $ex->getCode());
		}
		finally
		{
			// Parse array and create instances
			return new StaticData\StaticItemListDto($result, $this);
		}
	}
665409
public function getStaticMastery( int $mastery_id, string $locale = 'en_US', string $version = null ): StaticData\StaticMasteryDto
	{
		$result = false;
		try
		{
			// Fetch StaticData from JSON files
			$result = DataDragonAPI::getStaticMastery($mastery_id, $locale, $version);
			if (!$result) throw new ServerException("StaticData failed to be loaded.");

			$this->result_data = $result;
		}
		catch (DataDragonExceptions\SettingsException $ex)
		{
			throw new SettingsException("DataDragon API was not initialized properly! StaticData endpoints cannot be used.");
		}
		catch (DataDragonExceptions\ArgumentException $ex)
		{
			throw new RequestException($ex->getMessage(), $ex->getCode());
		}
		finally
		{
			// Parse array and create instances
			return new StaticData\StaticMasteryDto($result, $this);
		}
	}
514641
public function item($modelName, $itemId = 0)
    {
        $config            = app('itemconfig');
        $fieldFactory      = app('admin_field_factory');
        $actionFactory     = app('admin_action_factory');
        $columnFactory     = app('admin_column_factory');
        $actionPermissions = $actionFactory->getActionPermissions();
        $fields            = $fieldFactory->getEditFields();

        //if it's ajax, we just return the item information as json
        if ($this->request->ajax()) {
            //try to get the object
            $model = $config->getModel($itemId, $fields, $columnFactory->getIncludedColumns($fields));

            if ($model->exists) {
                $model = $config->updateModel($model, $fieldFactory, $actionFactory);
            }

            $response = $actionPermissions['view'] ? response()->json($model) : response()->json(array(
                'success' => false,
                'errors'  => 'You do not have permission to view this item',
            ));

            //set the Vary : Accept header to avoid the browser caching the json response
            return $response->header('Vary', 'Accept');
        } else {
            $view = view('administrator::index', array(
                'itemId' => $itemId,
            ));

            //set the layout content and title
            $this->layout->content = $view;

            return $this->layout;
        }
    }
715865
private function resolveProperty(Row $row, $name, $locale, $shadowLocale = null)
    {
        if (array_key_exists(sprintf('node.%s', $name), $row->getValues())) {
            return $row->getValue($name);
        }

        if (null !== $shadowLocale && !in_array($name, self::$nonFallbackProperties)) {
            $locale = $shadowLocale;
        }

        $name = sprintf('%s%s', $locale, str_replace('-', '_', ucfirst($name)));

        try {
            return $row->getValue($name);
        } catch (ItemNotFoundException $e) {
            // the default value of a non existing property in jackalope is an empty string
            return '';
        }
    }
1034771
public function findAllByLocale($locale, $filter = array())
    {
        if (empty($filter)) {
            $items = $this->itemRepository->findAllByLocale($locale);
        } else {
            $items = $this->itemRepository->findByLocaleAndFilter($locale, $filter);
        }

        array_walk(
            $items,
            function (&$item) use ($locale) {
                $item = $this->itemFactory->createApiEntity($item, $locale);
            }
        );

        return $items;
    }
356117
protected function _addItem( MW_Container_Content_Interface $contentItem, MShop_Attribute_Item_Interface $item, $langid )
	{
		$listTypes = array();

		foreach( $item->getListItems( 'text' ) as $listItem ) {
			$listTypes[ $listItem->getRefId() ] = $listItem->getType();
		}

		foreach( $this->_getTextTypes( 'attribute' ) as $textTypeItem )
		{
			$textItems = $item->getRefItems( 'text', $textTypeItem->getCode() );

			if( !empty( $textItems ) )
			{
				foreach( $textItems as $textItem )
				{
					$listType = ( isset( $listTypes[ $textItem->getId() ] ) ? $listTypes[ $textItem->getId() ] : '' );
					$items = array( $langid, $item->getType(), $item->getCode(), $listType, $textTypeItem->getCode(), '', '' );

					// use language of the text item because it may be null
					if( ( $textItem->getLanguageId() == $langid || is_null( $textItem->getLanguageId() ) )
						&& $textItem->getTypeId() == $textTypeItem->getId() )
					{
						$items[0] = $textItem->getLanguageId();
						$items[5] = $textItem->getId();
						$items[6] = $textItem->getContent();
					}

					$contentItem->add( $items );
				}
			}
			else
			{
				$items = array( $langid, $item->getType(), $item->getCode(), 'default', $textTypeItem->getCode(), '', '' );
				$contentItem->add( $items );
			}
		}
	}
491520
public function findByIdAndLocale($id, $locale)
    {
        try {
            $qb = $this->getShippingQuery($locale);
            $qb->andWhere('shipping.id = :shippingId');
            $qb->setParameter('shippingId', $id);

            return $qb->getQuery()->getSingleResult();
        } catch (NoResultException $exc) {
            return null;
        }
    }
1208382
public function findByOrderId($id, $locale = null)
    {
        try {
            $qb = $this->getShippingQuery($locale);
            $qb->andWhere('shipping.order = :id');
            $qb->setParameter('id', $id);

            return $qb->getQuery()->getResult();
        } catch (NoResultException $exc) {
            return null;
        }
    }
541457
public static function getStaticChampionsWithKeys( string $locale = 'en_US', string $version = null ) : array
	{
		$url = self::getStaticDataFileUrl(self::STATIC_CHAMPIONS, null, $locale, $version, self::STATIC_CHAMPION_BY_KEY);
		$data = self::loadCachedStaticData($url);
		if (!$data)
		{
			self::getStaticChampions($locale, $version);
			$data = self::loadCachedStaticData($url);
		}
		return $data;
	}
304928
public static function getStaticRune( int $rune_id, string $locale = 'en_US', string $version = null) : array
	{
		$data = self::getStaticRunes($locale, $version);
		if (isset($data['data'][$rune_id]) == false)
			throw new ArgumentException('Rune with given ID was not found.', 404);

		return $data['data'][$rune_id];
	}
1050943
public function getDocuments($orderId, $locale)
    {
        $documents = array();
        /** @var SalesDependencyClassInterface $dependency */
        foreach ($this->dependencyClasses as $dependency) {
            // add to documents array
            $documents = array_merge($documents, $dependency->getDocuments($orderId, $locale));
        }

        return $documents;
    }
1233090
public function itemUpdate($item_id, $fields)
    {
        // TODO: Tests
        $response = $this->getGuzzleClient()
            ->put(
                '/items/' . $item_id,
                array_merge($this->setQuery(), $this->setBodyArray($fields))
            );

        return $this->serializer->deserialize(
            $response->getBody()->getContents(),
            Item::class,
            'json'
        );
    }
1254983
public function findByLocaleAndInternalItemNumber($locale, $internalItemNumber)
    {
        $products = $this->productRepository->findByLocaleAndInternalItemNumber(
            $locale,
            $internalItemNumber
        );
        if ($products) {
            array_walk(
                $products,
                function (&$product) use ($locale) {
                    $product = $this->productFactory->createApiEntity($product, $locale);
                }
            );
        }

        return $products;
    }
1037264
public function findByOrderId($orderId, $locale)
    {
        $result = array();
        $items = $this->getShippingRepository()->findByOrderId($orderId, $locale);
        foreach ($items as $item) {
            $result[] = $this->shippingFactory->createApiEntity($item, $locale);
        }
        return $result;
    }