Get items of a specific model
@param string|core_kernel_classes_Resource $itemModel - the item model URI
@return core_kernel_classes_Resource[] the found items
519358
public function getAllByModel($itemModel)
    {
        if (!empty($itemModel)) {
            $uri = ($itemModel instanceof core_kernel_classes_Resource) ? $itemModel->getUri() : $itemModel;
            return $this->itemClass->searchInstances(array(
                $this->itemModelProperty->getUri() => $uri
            ), array(
                'recursive' => true
            ));
        }
        return array();
    }
164017
protected function getItems(array $items)
	{
		$result = array();
		foreach($items as $item) {
			$result[] = $this->getItem($item);
		}
		return $result;
	}
520637
public function fetchCacheData(AbstractModel $model)
    {
        $this->position = get_class($model);
        if (!isset($this->modelDataCache[$this->position])) {
            $this->modelDataCache[$this->position] = $this->prepareCacheData($model);
        }

        return $this->modelDataCache[$this->position];
    }
15786
public static function initFromItemClass($itemClass)
	{
		$itemMetaData = new ItemMetaData();
		$itemMetaData->setItemClass($itemClass);
		$contruct = new ReflectionMethod($itemClass, '__construct');
		/* @var $param \ReflectionParameter */
		foreach($contruct->getParameters() as $key => $param)
		{
			$itemMetaData->setHitPosition($param->getName(), $key);
			if(!$param->isOptional())
			{
				$itemMetaData->addRequiredHit($param->getName());
			}
		}
		return $itemMetaData;
	}
884959
public function getItem(EloquentModel $model, $transformer = null, $resourceKey = null)
    {
        $resource = new FractalItem(
            $model,
            $this->getTransformer($transformer),
            $this->getResourceKey($resourceKey)
        );

        if ($meta = $this->getMeta()) {
            $resource->setMeta($meta);
            $this->meta = [];
        }

        return $this->fractal->createData($resource)->toArray();
    }
829914
public function setModel($itemModel, $relations = [])
    {
        if (!class_exists($itemModel)) {
            throw new ModelNotFound('Could not find relation model');
        }

        $this->itemModel = $itemModel;
        $this->itemModelRelations = $relations;
    }
311040
public function setItemModel(core_kernel_classes_Resource $item, core_kernel_classes_Resource $model)
    {
        return $item->editPropertyValues($this->getProperty(self::PROPERTY_ITEM_MODEL), $model);
    }
283225
public function loadEntityDefinitions($itemClass)
	{
		$entities = array();
		$annotations = $this->reader->getClassAnnotations(new \ReflectionClass($itemClass));
		foreach($annotations as $annotation)
		{
			if($annotation instanceof ItemEntity)
			{
				/* @var $annotation \Emhar\SearchDoctrineBundle\Mapping\Annotation\ItemEntity */
				$entity = array();
				$entity['entityClass'] = $annotation->getEntityClass();
				$entity['label'] = $annotation->getLabel();
				$entities[$annotation->getIdentifier()] = $entity;
			}
		}
		return $entities;
	}
210727
public function getItemByUser($itemName, $userId)
    {
        if (empty($userId)) {
            return [];
        }

        $query = (new Query)->select('b.*')
            ->from(['a' => $this->assignmentTable, 'b' => $this->itemTable])
            ->where('{{a}}.[[item_name]]={{b}}.[[name]]')
            ->andWhere(['{{a}}.[[item_name]]' => (string) $itemName, 'a.user_id' => (string) $userId]);

        $role = $query->one($this->db);

        if(!empty($role))
            $role = $this->populateItem($role);

        return $role;
    }
796319
public function getModelDataAsArray(AbstractModel $model)
    {
        $reflectionClass = new \ReflectionClass($model);
        $set = [];

        foreach ($reflectionClass->getProperties() as $property) {
            /**
             * @todo move the check out into a validator
             */
            if (strpos($property->getDocComment(), 'ODM\\Property') !== false) {
                $property->setAccessible(true);
                $set[$property->getName()] = $property->getValue($model);
            }
        }

        return $set;
    }
1277624
public function getFlatSubItems()
    {
        $key = $this->getKey();
        $itemIds = Arr::get($this->_tree, $key);
        $flatItemIds = $this->_dot($itemIds, $key ? $key . '.' : '');
        $items = [];
        foreach ($flatItemIds as $itemId => $value) {
            $items[$itemId] = $this->_itemData[$itemId];
        }
        return $items;
    }
253232
protected function getItemLines()
    {
        $result = array();

        $orderProducts = $this->getOrderModel()->getOrderProducts($this->invoiceSource->getId());
        foreach ($orderProducts as $line) {
            $result[] = $this->getItemLine($line);
        }

        return $result;
    }
1249089
public function getModels()
    {
        $all = new Models();

        foreach ($this->items as $item) {
            $all->addAll($item->getCurrentAndOriginal());
        }

        return $all;
    }
122199
protected function getItemAttributes(ItemInterface $item)
    {
        $result = $item->getAttributes();

        $result['id'] = $item->getId();
        $result['content'] = $item->getContent();
        $result['collection'] = $item->getCollection();
        $result['path'] = $item->getPath(ItemInterface::SNAPSHOT_PATH_RELATIVE);

        return $result;
    }
871125
public function getItems()
    {
        if ($this->isModulesFetched === false) {
            $this->isModulesFetched = true;

            // Fetch items from modules
            foreach (Yii::$app->getModules() as $id => $module) {
                /** @var \yii\base\Module $module */
                $module = Yii::$app->getModule($id);
                if (method_exists($module, 'coreMenu')) {
                    $this->addItems($module->coreMenu(), true);
                }

                // Submodules support
                foreach ($module->getModules() as $subId => $subModule) {
                    $subModule = $module->getModule($subId);
                    if (method_exists($subModule, 'coreMenu')) {
                        $this->addItems($subModule->coreMenu(), true);
                    }
                }
            }
        }

        return $this->_items;
    }
427821
public function getItems(): array
    {
        $available = [];
        $assigned = [];

        foreach (array_keys($this->manager->getRoles()) as $name) {
            $available[$name] = 'role';
        }

        foreach (array_keys($this->manager->getPermissions()) as $name) {
            if ($name[0] != '/') {
                $available[$name] = 'permission';
            }
        }

        foreach ($this->manager->getAssignments($this->userId) as $item) {
            $assigned[$item->roleName] = $available[$item->roleName];
            unset($available[$item->roleName]);
        }

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

        return $this->_items;
    }