Returns the array of items for all provided item values.

@param mixed $itemValues
@param string $itemType

@return array
184006
private function getItems($itemValues, string $itemType): array
    {
        $items = [];

        foreach ((array) $itemValues as $itemValue) {
            try {
                $backend = $this->backendRegistry->getBackend($itemType);
                $item = $backend->loadItem($itemValue);
                $items[$item->getValue()] = $item;
            } catch (NotFoundException $e) {
                // Do nothing
            }
        }

        return $items;
    }
270948
public static function get_collection($component, $itemtype) {
        $itemtypes = self::get_areas();
        if (array_key_exists($itemtype, $itemtypes)) {
            if (!array_key_exists($component, $itemtypes[$itemtype])) {
                $component = key($itemtypes[$itemtype]);
            }
            return $itemtypes[$itemtype][$component]->tagcollid;
        }
        return core_tag_collection::get_default();
    }
842308
public function find($itemId)
    {
        foreach ($this->items as $item) {
            if ($itemId === $item->id) {
                return $item;
            }
        }

        return;
    }
49489
public function setItemListElements($itemListElements) {
		if (!is_array($itemListElements)) {
		    throw new \Exception('The value is expected to be an array');
		}
		foreach ($itemListElements as $itemListElement) {
		    if (!$itemListElement instanceof Property\ItemListElement) {
		        throw new \Exception('Unexpected value type');
		    }
		}
		$this->itemListElement = $itemListElements;

		return $this;
	}
640503
protected function getItem($itemType, $itemId, TagAttributes $attr)
    {
        $data = '';

        switch ($itemType) {

            case self::LAYOUT_WIDGET:
                try {
                    /** @var $data \PageBuilder\BaseWidget */
                    $widgetName = $itemId . WidgetFactory::WIDGET_SUFFIX;
                    $options    = $attr->getOptions();

                    if (!$this->isShared($options)) {
                        $this->getServiceLocator()->setShared($widgetName, false);
                    }

                    if (array_key_exists('shared', $options) and empty($options['shared'])) {
                        $this->getServiceLocator()->setShared($widgetName, false);
                    }

                    $data = $this->getServiceLocator()->get($widgetName);
                    $attr->addClass($data->getId());
                    $data->setAttributes($attr);
                } catch (ServiceNotFoundException $e) {
                    $data = '';
                }

                break;
            case self::LAYOUT_USER_DEFINED:
                /** @var $componentModel \PageBuilder\Model\ComponentModel */
                $componentModel = $this->getServiceLocator()->get('pagebuilder\model\component');

                /** @var $component \PageBuilder\Entity\Component */
                if ($component = $componentModel->findOneTranslatedBy(['id' => $itemId])) {
                    $data     = $this->transform($component->getContent());
                    $comId    = "data-id='{$itemType}-{$itemId}'";
                    $cssClass = trim("{$itemType} {$component->getCssClass()}");
                    $attr->addClass($cssClass)
                        ->addClass($component->getCssId())
                        ->addAttr($comId)
                        ->addAttr("id='{$component->getCssId()}'");

                    //Apply replaces to the output
                    $replacements = $this->getOptions()->getReplacements();
                    $data         = str_replace(array_keys($replacements), array_values($replacements), $data);

                    //apply formats to the data
                    $data = $this->applyFormats($data);
                }

                break;
            default:
                $message = 'Layout itemType ' . $itemType . ' not found';
                if ($this->serviceManager->has('logger')) {
                    $this->serviceManager->get('logger')->err($message);
                } else {
                    throw new RuntimeException($message);
                }
        }

        return new WidgetData(
            [
                'data'       => $data,
                'attributes' => $attr,
            ]
        );
    }
619169
public function microData($itemType, $itemProp)
    {
        //====================================================================//
        // Safety Checks ==> Verify a new Field Exists
        if (empty($this->new)) {
            Splash::log()->err("ErrFieldsNoNew");
        } else {
            //====================================================================//
            // Update New Field structure
            $this->new->itemtype = $itemType;
            $this->new->itemprop = $itemProp;
            $this->setTag($itemProp.IDSPLIT.$itemType);
        }

        return $this;
    }
258499
public function set($itemName, $itemValue)
    {
        list($validationResult, $message) = IniParser::i()->validateItemName($itemName);
        if (false === $validationResult)
        {
            throw new InvalidDataException($message);
        }
        $this->contents[$itemName] = IniParser::i()->itemValuetoStringRepresentation($itemValue);

        return $this;
    }
488998
public function getItemByPath(string $path, string $itemId = ''):array
    {
        if (empty($itemId)) {
            return $this->get("Items/ByPath?Path={$path}");
        } else {
            return $this->get("Items({$itemId})/ByPath?Path={$path}");
        }
    }
709364
public function itemType() {
    $itemtype = $this->getAttribute('itemtype');
    if (!empty($itemtype)) {
      return $this->tokenList($itemtype);
    }
    // Return NULL instead of the empty string returned by getAttributes so we
    // can use the function for boolean tests.
    return NULL;
  }
115755
public function updateColumns($itemType, &$columns)
    {
        if ($itemType !== 'Pages') {
            return;
        }

        // Check if pages has the tags field
        if (!self::enabled()) {
            return;
        }

        // Set column
        $field = Config::inst()->get(__CLASS__, 'tag_field');
        $columns['Terms'] = [
            'printonly' => true, // Hide on page report
            'title' => _t('SilverStripe\\SiteWideContentReport\\SitewideContentReport.Tags', 'Tags'),
            'datasource' => function ($record) use ($field) {
                $tags = $record->$field()->column('Name');

                return implode(', ', $tags);
            },
        ];
    }
627717
public function GetCommentsPage(int $itemType = GnCommentItemType::Community, string $itemKey = NULL, int $pageSize = NULL, int $lastKnownTicks = GnSettings::FAR_FUTURE_TICKS)
    {
        $result = $this->ExecuteCall("GetCommentsPage", (object)[
            "itemType" => $itemType,
            "itemKey" => $itemKey,
            "pageSize" => $pageSize,
            "lastKnownTicks" => $lastKnownTicks
        ], GnResponseType::ListGnComment);

        return $result;
    }
520678
private function parseArrayToFieldEntity(array $item, $elementType)
    {
        $entity = new Field();
        $entity->set($item);
        $entity->element_type = $elementType;

        return $entity;
    }
1221245
@SuppressWarnings("unchecked")
   public <T> List<T> asList(Class<T> itemType) {
      return asCollection(List.class, itemType);
   }
543947
public function getValues() {
        $result = array();

        foreach ($this->items as $key => $entry) {
            $result[] = $entry->value;
        }

        return $result;
    }
340940
public function visitItemsConstraint(ArrayValue\ItemsConstraint $constraint)
    {
        $value = $this->currentValue();
        if (!$value instanceof Value\ArrayValue) {
            return $this->createResult();
        }

        $result = $this->createResult();
        $matchedIndices = array();

        // items
        foreach ($constraint->schemas() as $index => $schema) {
            if ($value->has($index)) {
                $matchedIndices[$index] = true;
                $result = $result->merge(
                    $this->validateArrayIndex($index, $schema)
                );
            } elseif (null !== $schema->defaultValue()) {
                $result = $result->merge(
                    $this->createResult(
                        array(),
                        array($this->createDefaultValueMatch($schema, $index))
                    )
                );
            }
        }

        // additional items
        foreach ($value->keys() as $index) {
            if (!array_key_exists($index, $matchedIndices)) {
                $result = $result->merge(
                    $this->validateArrayIndex(
                        $index,
                        $constraint->additionalSchema()
                    )
                );
            }
        }

        return $result;
    }
1228880
public function getItems($itemName = null)
    {
        if ($itemName && isset($this->_items[$itemName])) {
            return $this->_items[$itemName];
        }

        return $this->_items;
    }
1224639
public static function get_showstandard($component, $itemtype) {
        $itemtypes = self::get_areas();
        if (array_key_exists($itemtype, $itemtypes)) {
            if (!array_key_exists($component, $itemtypes[$itemtype])) {
                $component = key($itemtypes[$itemtype]);
            }
            return $itemtypes[$itemtype][$component]->showstandard;
        }
        return core_tag_tag::BOTH_STANDARD_AND_NOT;
    }