@param string $className
@param array  $ids

@return ResultInterface
324253
public static function deleteByIds($className, array $ids): ResultInterface
    {
        list($table, , $idColumn) = self::getTable($className);
        $instance = self::getInstance($className);

        $query = Query::table($table)->whereIn($idColumn, $ids)->selectInstance($instance);

        return $query->delete();
    }
446960
public function getByNamedId($classname, $name, $id)
    {
        if (!isset($this->namedId[$classname]) || !in_array($name, $this->namedId[$classname])) {
            throw new InvalidNamedIdExeption('NamedId ' . $name . ' is not a valid type');
        }
        if (!preg_match('/^[a-zA-Z0-9\- _]+$/D', $id)) {
            throw new InvalidIdException('Invalid id: ' . $id);
        }
        $response = $this->request($this->buildUrl(new $classname(), null, '/' . $name . '/' . $id), 'GET');
        return $this->mapper->mapFromStorage($response);
    }
88625
public function filterByIds($ids)
    {
        $this->getInstance()->andWhere($this->mainAlias.'.id IN (:ids)')->setParameter('ids', $ids);

        return $this;
    }
1199922
public function remove($ids = [])
    {
        if (!is_array($ids)) {
            $ids = [$ids];
        }

        $result = $this->request(
            'POST',
            $this->getCore() . '/update/json',
            [],
            [
                'delete' => $ids
            ]
        );

        if ($this->isAutoCommit()) {
            $this->commit();
        }

        return $result;
    }
992819
public static function findByIds($ids, $throwException = true)
    {
        $ids = array_unique($ids);
        $ids = array_map('intval', $ids);
        $ids2find = array_diff($ids, array_keys(static::$identityMap));
        if (count($ids2find) > 0) {
            Property::find()->where(['in', 'id', $ids2find])->all();
        }

        return array_reduce(
            $ids,
            function ($carry, $id) use ($throwException) {
                if (isset(static::$identityMap[$id])) {
                    $carry[$id] = static::$identityMap[$id];
                } elseif ($throwException) {
                    throw new \RuntimeException("Property $id not found");
                }
                return $carry;
            },
            []
        );
    }
291235
public function select($collectionName, array $ids)
    {
        $mappedIds = array_map(function ($id) use ($collectionName) {
            return sprintf('%s:%s', $collectionName, $id);
        }, $ids);
        $params = ['foreign_ids' => join(',', $mappedIds)];
        $response = $this->doRequest('GET', 'meta/', $params);
        $body = $response->getBody()->getContents();
        return json_decode($body, true);
    }
687207
private function getInstancesList(array $ids)
    {
        $statuses = $instances = $classes = [];

        foreach ($ids as $key => $instance) {
            $instance = $this->getResource($instance);
            if ($instance->isClass()) {
                $instance = $this->getClass($instance);
                $classes[] = $instance;
            } elseif (!$instance->exists()) {
                $statuses[$instance->getUri()] = [
                    'success' => false,
                    'message' => sprintf('Instance "%s" does not exist', $instance->getUri()),
                ];
                break;
            }
            $instances[$key] = $instance;
        }

        return [
            $statuses,
            $instances,
            $classes
        ];
    }
103824
private function _getPage($ids)
    {
        $object = $this->_pager['object'];
        $method = $this->_pager['method'];
        $methodArgs = [];
        foreach ($this->_pager['methodArgs'] as $arg) {
            array_push($methodArgs, $arg);
        }
        array_push($methodArgs, $ids);

        return call_user_func_array(
            [$object, $method],
            $methodArgs
        );
    }
836957
protected static function getPageResult($responseBody, array $headers, $className)
    {
        $data = json_decode($responseBody, true);
        $result = new PageResult($data['results'], $data['total'], $data['total_pages'], $headers, $className);

        return $result;
    }
697026
public function getResultsAsObjects($classname)
    {
        $new = array();
        foreach ((array) $this->results as $result) {
            if (is_array($result))
                $new[] = new $classname($result);
            else
                $new[] = $result;
        }
        return $new;
    }
425570
public function findByIds(array $ids): array
    {
        $result = [];
        if (count($ids) > 0) {
            $queryBuilder = $this->entityManager->createQueryBuilder();
            $queryBuilder->select('i')
                         ->from(Item::class, 'i')
                         ->andWhere('i.id IN (:ids)')
                         ->setParameter('ids', array_values($ids));

            $result = $queryBuilder->getQuery()->getResult();
        }
        return $result;
    }
52293
public function get_from_ids(array $ids) {
        $alias = $this->get_table_alias();
        list($insql, $params) = $this->get_db()->get_in_or_equal($ids);
        $wheresql = $alias . '.id ' . $insql;
        $sql = $this->generate_get_records_sql($wheresql);
        $records = $this->get_db()->get_records_sql($sql, $params);

        return $this->transform_db_records_to_entities($records);
    }
812119
private function cacheIDsAndReturnUnresolvedIDs(Collection $names, Collection $ids) : Collection
    {
        $names->each(function ($name) {

            cache([$this->prefix . $name['id'] => $name['name']], carbon()->addCentury());
            $this->response[$name['id']] = $name['name'];

            UniverseName::firstOrCreate([
                'entity_id' => $name['id'],
            ], [
                'name'      => $name['name'],
                'category'  => $name['category'],
            ]);
        });

        $ids = $ids->filter(function ($id) use ($names) {

            return ! $names->contains('id', $id);
        });

        return $ids;

    }
301671
protected function findObjects(array $ids)
    {
        $foundObjects = $this->domain->getRepository()->findBy([
            $this->identifier => array_unique($ids),
        ]);
        $mapFinds = [];
        $objects = [];

        foreach ($foundObjects as $foundObject) {
            $id = $this->propertyAccessor->getValue($foundObject, $this->identifier);
            $mapFinds[$id] = $foundObject;
        }

        foreach ($ids as $i => $id) {
            $objects[$i] = $mapFinds[$id]
                ?? $this->domain->newInstance($this->defaultValueOptions);
        }

        return $objects;
    }
333325
public function selectColByIdsPreserveIds(array $ids = array(), $columnName = 'id')
    {
        if (empty($ids)) {
            return array();
        }

        $_query = $this->getSelectQueryByIds($ids);
        $_columnIndexId = $this->_getColumnIndexInSelectQuery($this->getIdentityColumn());
        $_columnIndex = $this->_getColumnIndexInSelectQuery($columnName);

        if ($_columnIndex === false || $_columnIndexId === false) {
            throw new \InvalidArgumentException(get_called_class() . '::' . __FUNCTION__ . '() Invalid column name given as second parametter. "' . $columnName . '" given');
        }

        $_stmt1 = $this->db->getAdapter()->query($_query);
        $columnIndexId = $_stmt1->fetchAll(Zend_Db::FETCH_COLUMN, $_columnIndexId);

        $_stmt2 = $this->db->getAdapter()->query($_query);
        $columnIndex = $_stmt2->fetchAll(Zend_Db::FETCH_COLUMN, $_columnIndex);
        $res = array_combine($columnIndexId, $columnIndex);
        if ($res !== false) {
            return $res;
        } else {
            throw new \RuntimeException("Not same count between ID and selected COLUMN");
        }
    }
1247040
public function idsAction($ids)
    {
        $items = $this->get('opifer.content.content_manager')
            ->getRepository()
            ->findByIds($ids);

        $contents = $this->get('jms_serializer')->serialize($items, 'json', SerializationContext::create()->setGroups(['list'])->enableMaxDepthChecks());

        $data = [
            'results'       => json_decode($contents, true),
            'total_results' => count($items)
        ];

        return new JsonResponse($data);
    }
1019423
public function findByIds(array $ids)
    {
        $args = [];
        $manager = $this->getManager();
        $args['body']['docs'] = [];
        $args['index'] = $manager->getIndexName();
        $args['type'] = $this->getType();

        foreach ($ids as $id) {
            $args['body']['docs'][] = [
                '_id' => $id
            ];
        }

        $mgetResponse = $manager->getClient()->mget($args);

        $return = [
            'hits' => [
                'hits' => [],
                'total' => 0,
            ]
        ];

        foreach ($mgetResponse['docs'] as $item) {
            if ($item['found']) {
                $return['hits']['hits'][] = $item;
            }
        }

        $return['hits']['total'] = count($return['hits']['hits']);

        return new DocumentIterator($return, $manager);
    }