FinderTrait::findIn

@param array       $inCriteria
@param string|null $field

@return bool|\O2System\Framework\Models\Sql\DataObjects\Result
331733
public function findIn(array $inCriteria, $field = null)
    {
        $field = isset($field) ? $field : $this->primaryKey;
        $field = $this->table . '.' . $field;

        if ($result = $this->qb
            ->from($this->table)
            ->whereIn($field, $inCriteria)
            ->get()) {
            $this->result = new DataObjects\Result($result, $this);
            $this->result->setInfo($result->getInfo());

            return $this->result;
        }

        return false;
    }
1004592
public function whereNotIn($field = '', $in = array())
		{
			$this->_whereInit($field);
			$this->wheres[$field]['$nin'] = $in;

			return $this;
		}
220300
public function findOne()
    {
        $this->updateMap();

        return $this->entityRepository->findOne()->with('id', Operator::IN, $this->map);
    }
115304
function find($filter=NULL,array $options=NULL,$ttl=0) {
		if (!$options)
			$options=[];
		$options+=[
			'group'=>NULL,
			'order'=>NULL,
			'limit'=>0,
			'offset'=>0
		];
		$adhoc='';
		foreach ($this->adhoc as $key=>$field)
			$adhoc.=','.$field['expr'].' AS '.$this->db->quotekey($key);
		return $this->select(
			($options['group'] && !preg_match('/mysql|sqlite/',$this->engine)?
				$options['group']:
				implode(',',array_map([$this->db,'quotekey'],
					array_keys($this->fields)))).$adhoc,$filter,$options,$ttl);
	}
297432
public function findOne()
    {
        $finder = $this->dataMapper->findOne();

        foreach ($this->restrictions as $filter) {
            $finder = $finder->with($filter['field'], $filter['op'], $filter['value']);
        }

        return $finder;
    }
1014453
public function findByField($fieldName, $value) {
    $dataConnection = $this->app->getDataConnection($this->connection);
    if ($fieldName == $this->idColumn) {
      $value = $dataConnection->convertToNativeId($value);
    }
    $result = $dataConnection->findOneByField($fieldName, $value, $this->table, $this->readFields);
    if ($result == NULL) {
      return FALSE;
    }
    $this->load($result);
    return TRUE;
  }
952155
public function findWhereNotIn($field, array $values, $columns = ['*'])
    {
        $this->applyCriteria();
        $this->applyScope();
        $model = $this->model->whereNotIn($field, $values)->get($columns);
        $this->resetModel();

        return $this->parserResult($model);
    }
1320156
public function find( $table, $fields = null, $where = null, $order = null, $limit = null, $offset = null, $array = array (), $fetchMode = \PDO::FETCH_ASSOC )
     {
         // TODO: Implement find() method.
     }
711258
public function findOne(array $query = array(), array $fields = array())
    {
        $cursor = $this->find($query, $fields)->limit(1);

        return $cursor->getNext();
    }
869936
function find($filter=NULL,array $options=NULL,$ttl=0) {
		if (!$options)
			$options=[];
		$options+=[
			'group'=>NULL,
			'order'=>NULL,
			'limit'=>0,
			'offset'=>0
		];
		return $this->select($this->fields,$filter,$options,$ttl);
	}
32241
public function find($table, $fields = null, $where = null, $order = null, $limit = null, $offset = null, $array = array(), $fetchMode = \PDO::FETCH_ASSOC)
     {
         $sql = ' SELECT '.(($fields) ?? '*').' FROM '.(($table)).(($where) ? ' WHERE '.$where : ' ')
            .(($limit) ? ' LIMIT '.$limit : ' ')
            .(($offset && $limit) ? ' OFFSET '.$offset : ' ')
            .(($order) ? ' ORDER BY '.$order : ' ');

         $stmt = $this->conn->prepare($sql);

         foreach ($array as $key => $values) {
             return  $stmt->bindValue("$key", $values);
         }
         $stmt->execute();

         do {
             return $stmt->fetchAll($fetchMode);
         } while (
            $stmt->nextRowset());
         $stmt->close();
     }
358172
public function findBy($field, $value = false, bool $failable = true)
    {
        $query = $this->newQuery();

        if(is_array($field)) {
            $failable = $value === true ? true : false;
            foreach ($field as $k => $v) {
                $query->where($k, $v);
            }
        } else {
            $query->where($field, $value);
        }

        if ($failable == true) {
            return $query->firstOrFail();
        }

        return $query->first();
    }
755601
public function findField($field)
	{
		$fields = $this->getEditFields();

		//return either the Field object or throw an InvalidArgumentException
		if (!isset($fields[$field]))
		{
			throw new \InvalidArgumentException("The " . $field . " field does not exist on the " . $this->config->getOption('name') . " model");
		}

		return $fields[$field];
	}
1174342
public static function findOrThrow($param, $field = '*', $parameters = array()) {
        $model = static::find($param, $field, $parameters);
        if (empty($model)) {
            throw new \InvalidArgumentException($param);
        }
        return $model;
    }
160106
public function findOneById($collection, $id, array $fields = [])
    {
        try {
            $id = new \MongoDB\BSON\ObjectID((string) $id);
        } catch (\Exception $e) {
            return;
        }

        $queryOptions = new QueryOptions();
        $queryOptions->setQueryParams([
            '_id' => $id,
        ]);

        return $this->findOne($collection, $queryOptions, $fields);
    }
1073803
public function findByField($field, $value = null, $columns = ['*'])
    {
        if (!$this->allowedCache('findByField') || $this->isSkippedCache()) {
            return parent::findByField($field, $value, $columns);
        }

        $key = $this->getCacheKey('findByField', func_get_args());
        $minutes = $this->getCacheMinutes();
        $value = $this->getCacheRepository()->remember($key, $minutes, function () use ($field, $value, $columns) {
            return parent::findByField($field, $value, $columns);
        });

        $this->resetModel();
        $this->resetScope();
        return $value;
    }
596189
public function find($query, $fields = ['username', 'email']): UserInterface
    {
        foreach ((array)$fields as $field) {
            if ($field === 'key') {
                $user = $this->get($query);
            } elseif ($field === 'storage_key') {
                $user = $this->withKeyField('storage_key')->get($query);
            } elseif ($field === 'flex_key') {
                $user = $this->withKeyField('flex_key')->get($query);
            } elseif ($field === 'email') {
                $user = $this->withKeyField('email')->get($query);
            } elseif ($field === 'username') {
                $user = $this->get(mb_strtolower($query));
            } else {
                $user = $this->__call('find', [$query, $field]);
            }
            if ($user) {
                return $user;
            }
        }

        return $this->load('');
    }