Find a record.

@param mixed $id      The id to find.
@param array $columns List of columns to get.

@return DynamoDbModel|null The model, or null if nothing found.
346304
public static function find($id, array $columns = [])
    {
        $model = static::getInstance();
        $key   = static::getModelKey($id, $model);
        $query = [
            'ConsistentRead' => true,
            'TableName'      => $model->getTable(),
            'Key'            => $key,
        ];
        if ( ! empty( $columns )) {
            $query['AttributesToGet'] = $columns;
        }
        $item = $model->client->getItem($query);
        $item = array_get($item->toArray(), 'Item');
        if (empty( $item )) {
            return null;
        }
        $item = $model->unmarshalItem($item);
        $model->fill($item);
        // Set the model id field.
        $model->setId($id);
        $model->exists = true;
        $model->syncOriginal();

        return $model;
    }
424656
public function findOrFail($id, $columns = ['*'])
    {
        $this->newQuery();

        if ($result = $this->query->find($id, $columns)) {
            return $result;
        }

        throw (new ModelNotFoundException)->setModel($this->model);
    }
310899
public function findIdColumn($id, $column) {
		if (!empty($column)) $this->driver->field($column);
		$tableAlias = $this->driver->alias?$this->driver->alias.'.':'';
		return $this->driver->where($tableAlias.$this->id.'=?', [$id])
            ->fetchColumn();
	}
1165348
public static function find($collection, $id)
    {
        $id = intval($id);
        foreach ($collection as $entity) {
            if ($id === $entity->getId()) {
                return $entity;
            }
        }

        return null;
    }
763574
public function findMany($id, $columns = array('*'))
	{
		$this->query->whereIn($this->model->getKeyName(), $id);

		return $this->get($columns);
    }
1185922
public function findOrFail($id, $columns = ['*'])
    {
        $this->parse();

        return $this->getHandler()->findOrFail($id, $this->getColumns($columns));
    }
140606
public static function loadById(int $id, string $column = '') {
		$class = get_called_class();
		$model = new $class();
		$pk = $model->pk;
		$last = array_pop($model->pk);
		$result = $model->get([
			'where' => [
				$last => $id
			],
			'pk' => [$last],
			'single_row' => true,
			'skip_acl' => true
		]);
		if (!empty($column)) {
			return $result[$column] ?? null;
		}
		return $result;
	}
28239
public function findOrNew($id, $columns = ['*'])
    {
        if (!is_null($model = $this->find($id, $columns))) {
            return $model;
        }

        return $this->model->newInstance()->setConnection(
            $this->query->getConnection()->getName()
        );
    }
1247123
public function findOrNew($id, $columns = ['*'])
    {
        if (! is_null($model = $this->find($id, $columns))) {
            return $model;
        }

        return $this->newModelInstance();
    }
521470
private function find($id): ?Model
    {
        try {
            return $this->repository->findOrFail($id);
        } catch (ModelNotFoundException $exception) {
            return null;
        }
    }
856879
public function find($id, $columns = ['*'])
    {
        $this->applyCriteria();
        $this->applyScope();
        $model = $this->model->findOrFail($id, $columns);
        $this->resetModel();

        return $this->parserResult($model);
    }
474955
public function find($find, $column = 'id', array $relations = [], array $columns = ['*'])
    {
        $this->model = $this->where($column, $find);
        $this->model = $this->relation->apply($this->model, $this, $relations);

        return $this->model->firstOrFail($columns);
    }
685863
public function find($id, $columns = ['*'])
    {
        $this->parse();

        return $this->getHandler()->find($id, $this->getColumns($columns));
    }
492249
public function find($id, $columns = ['*'])
    {
        return is_array($id) ? $this->findMany($id, $columns) : $this->where(
            $this->getRelated()->getQualifiedKeyName(), '=', $id
        )->first($columns);
    }
286490
public function find($id, array $columns = ['*'])
    {
        $model = $this->model;

        return $model::find($id, $columns);
    }
96072
public static function find($id) 
    {
        self::_checkLoaded();

        $pk               = self::isIgnoringCase() ? strtolower(self::getPK()) : self::getPK();
        $builder          = self::_makeBuilder();
        $builder->fields  = self::extractColumns();
        $builder->where   = self::_extractWhereConditions(array($pk=>$id));
        $builder->limit   = 1;

        $cls  = get_called_class();
        $stmt = self::executePrepared($builder, array($id));
        $data = $stmt->fetch(\PDO::FETCH_ASSOC);

        if (!$data) {
            return null;
        }
        return new $cls($data);
    }
872184
public function findByUuid($uuid, $columns = ['*'])
    {
        if (is_array($uuid) || $uuid instanceof Arrayable) {
            return $this->findManyByUuid($uuid, $columns);
        }

        return $this->whereUuidKey($uuid)->first($columns);
    }