Adds criteria to find by id

@param array $ids the array of ids to find
356065
public function findByIds(array $ids)
    {
        $ids = $this->getRepository()->idsToMongo($ids);
        return $this->mergeCriteria(array('_id' => array('$in' => $ids)));
    }
481431
public function remove($ids)
    {
        if (!$this->isEmpty() &&
            ($remove = $this->_resolveIds($ids))) {
            $this->_ids = array_diff($this->_ids, array_unique($remove));
        }
    }
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
        ];
    }
192783
public function findByIds(array $ids): array
    {
        $spec = $this->createSpecification()->where(['id' => $ids]);

        return $this->findAll($spec);
    }
1015900
public function delete(array $ids)
    {
        if (!count($ids)) {
            return;
        }
        $ids_str = implode(',', $ids);
        $db = Db::obtain();
        $slots = $db->fetchArrayPDO(
            'SELECT id FROM ' . Db::realTablename('slots') . ' WHERE match_id IN (' . $ids_str . ')',
            array()
        );
        $slotsFormatted = array();
        foreach ($slots as $slot) {
            array_push($slotsFormatted, $slot['id']);
        }
        if (count($slotsFormatted)) {
            $slots_str = implode(',', $slotsFormatted);
            $db->exec('DELETE FROM ' . Db::realTablename('ability_upgrades') . ' WHERE slot_id IN (' . $slots_str . ')');
            $db->exec('DELETE FROM ' . Db::realTablename('additional_units') . ' WHERE slot_id IN (' . $slots_str . ')');
            $db->exec('DELETE FROM ' . Db::realTablename('slots') . ' WHERE id IN (' . $slots_str . ')');
        }
        $db->exec('DELETE FROM ' . Db::realTablename('picks_bans') . ' WHERE match_id IN (' . $ids_str . ')');
        $db->exec('DELETE FROM ' . Db::realTablename('matches') . ' WHERE match_id IN (' . $ids_str . ')');
    }
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);
    }
1273402
protected function validateIds( array $ids )
	{
		$list = [];

		foreach( $ids as $id )
		{
			if( $id != '' && preg_match( '/^[A-Za-z0-9\-\_]+$/', $id ) === 1 ) {
				$list[] = (string) $id;
			}
		}

		return $list;
	}
1187419
final public function find($ids=[]) {
      if (func_num_args()>0) {
         if (func_num_args()===1) {
            if (!is_array($ids)) {
               $ids = (array) $ids ;
            }
         }
         else {
            $ids = func_get_args();
         }
      }

      $closure = NULL;
      if ( count(func_get_args())>1 ) {
         if ( $ids[count($ids)-1] instanceof \Closure ) {
            $closure = array_pop($ids);
         }
         if (is_array($ids[0])) {
            $ids = $ids[0];
         }
      }

      $this->find_first_data = $this->find_save_data = $this->find_delete_data = TRUE;

      if ( count($ids) && !(@$ids[0] instanceof \Closure) ) {
         if ( $this->is_assoc( $ids ) ) {
            $this->where( $ids );
         }
         else {
            $this->where( $this->primaryKey, 'in', $ids );
         }
      }

      $this->get();

      if (count($ids)===1 && count($this->data)===1) {
         $this->data = $this->data[0];
      }

      if ($closure instanceof \Closure) {
         $this->data = $closure( $this->data, $this );
      }

      return $this;
   }
1172648
protected function infoByIds($ids)
	{
		if (count($ids) > 40)
		{
			throw new ListMaxException('This request can only support a list of 40 elements, '.count($ids).' given.');
		}
		$idList = implode(',', $ids);

		$array     = $this->request('summoner/'.$idList);
		$summoners = [];
		foreach ($array as $info)
		{
			$summoner               = $this->attachStaticDataToDto(new Dto\Summoner($info));
			$name                   = $summoner->name;
			$this->summoners[$name] = $summoner;
			$summoners[$name]       = $summoner;
		}

		return $summoners;
	}
75547
public function setIds(array $ids)
    {
        $actualIds = [];

        foreach ($ids as $id) {
            $this->assertValidId($id);
            $actualIds[] = $id;
        }

        $this->clearCachedValueIf($this->ids != $actualIds);
        $this->ids = $actualIds;
    }
253006
public final function setIds(array $ids): void
    {
        foreach ($ids as $id) {
            $this->ids[] = (int) $id;
        }
    }
88625
public function filterByIds($ids)
    {
        $this->getInstance()->andWhere($this->mainAlias.'.id IN (:ids)')->setParameter('ids', $ids);

        return $this;
    }
815753
public function findActionsForIds(array $ids)
    {
        if (empty($ids)) {
            return array();
        }

        $datas = $this->client->hmget($this->getActionKey(), $ids);

        return array_values(
            array_map(
                function ($v) {
                    return unserialize($v);
                },
                $datas
            )
        );
    }
703647
protected function load(array $ids = array())
    {
        $idsNotFound = array_filter($ids);

        $output = array();

        $stores = $this->stores;

        foreach ($this->stores as $storeName => $store) {
            if (!empty($idsNotFound)) {
                $objects = $store->load($idsNotFound);

                $loadedKeys = array_keys($objects);
                $remainingKeys = array_values(array_diff($idsNotFound, $loadedKeys));
                $idsNotFound = $remainingKeys;
                $output = $output + $objects;

                if (!empty($objects) && $store == $this->primaryStore) {
                    foreach ($stores as $storeName2 => $store2) {
                        if ($storeName2 !== $storeName) {
                            $ret = $store2->saveMulti($objects);
                        }
                    }
                }
            }
        }


        return $output;
    }
589236
public static function scopesFor(array $ids)
    {
        return collect($ids)->map(function ($id) {
            if (isset(static::$scopes[$id])) {
                return new Scope($id, static::$scopes[$id]);
            }

            return;
        })->filter()->values()->all();
    }
974910
public static function deleteByIds($ids, array $params = [])
    {
        if (!is_array($ids)) {
            $ids = explode(",", $ids);
        }

        $m = new static;
        $pk = $m->getPrimaryKey();
        $records = [];
        foreach ($ids as $id) {
            $records[] = [$pk => $id];
        }

        return static::bulkDelete($records, $params);
    }
6131
public static function selectByIds($ids, array $options = [], array $criteria = [])
    {
        $criteria = static::cleanCriteria($criteria);
        if (empty($criteria)) {
            $criteria['select'] = ['*'];
        }

        if (is_array($ids)) {
            $ids = implode(',', $ids);
        }

        $pk = static::getPrimaryKeyStatic();
        if (!empty($ids)) {
            $idsPhrase = " $pk IN ($ids) ";

            $condition = array_get($criteria, 'condition');

            if (!empty($condition)) {
                $condition .= ' AND ' . $idsPhrase;
            } else {
                $condition = $idsPhrase;
            }

            $criteria['condition'] = $condition;
        }

        $data = static::selectByRequest($criteria, $options);

        $data = static::cleanResult($data, array_get($criteria, 'select'));
        if (!is_array($ids)) {
            $ids = explode(',', $ids);
        }
        if (count($data) != count($ids)) {
            $out = [];
            $continue = array_get_bool($options, ApiOptions::CONTINUES);
            foreach ($ids as $index => $id) {
                $found = false;
                foreach ($data as $record) {
                    if ($id == array_get($record, $pk)) {
                        $out[$index] = $record;
                        $found = true;
                        break;
                    }
                }
                if (!$found) {
                    $out[$index] = new NotFoundException("Record with identifier '$id' not found.");
                    if (!$continue) {
                        break;
                    }
                }
            }

            throw new BatchException($out, 'Batch Error: Not all requested records could be retrieved.');
        }

        return $data;
    }