Find a model by its primary key or throw an exception.

@param mixed $id
@param array $columns

@throws \Analogue\ORM\Exceptions\EntityNotFoundException

@return mixed|self
340125
public function findOrFail($id, $columns = ['*'])
    {
        if (!is_null($entity = $this->find($id, $columns))) {
            return $entity;
        }

        throw (new EntityNotFoundException())->setEntity(get_class($this->entityMap));
    }
1347993
public function get($id): Column
    {
        if ($this->offsetExists($id)) {
            return $this->offsetGet($id);
        }

        return $this->getByName($id);
    }
1343134
public function findOrderEntityById($id)
    {
        try {
            return $this->em
                ->getRepository(static::$orderEntityName)
                ->find($id);
        } catch (NoResultException $nre) {
            throw new EntityNotFoundException(static::$orderEntityName, $id);
        }
    }
595622
public function findBy($column, $value, array $columns = ['*'])
    {
        return $this->where([$column => $value], '=', null, 'and', $columns)->first();
    }
515159
public function find($id, $columns = ['*'])
    {
        if (is_array($id) || $id instanceof Arrayable) {
            return $this->findMany($id, $columns);
        }

        return $this->whereKey($id)->first($columns);
    }
96556
public function findMany($ids, array $columns = ['*'])
    {
        if (empty($ids)) {
            return $this->model->newCollection();
        }

        $this->getBuilder()->whereIn($this->getModel()->getQualifiedKeyName(), $ids);

        return $this->get($columns);
    }
1277800
public function column_check( $id = false, $column = false )
	{
		$sql = "SELECT COLUMN_CHECK($column) FROM `{$this->table}` WHERE id = :id";
		$params = [ ':id' => $id ];

		return $this->select_one( $sql, $params );
	}
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);
    }
1185922
public function findOrFail($id, $columns = ['*'])
    {
        $this->parse();

        return $this->getHandler()->findOrFail($id, $this->getColumns($columns));
    }
461656
public function find($id)
    {
        try
        {
            $model = $this->model->findOrFail($id);
        }
        catch(ModelNotFoundException $e)
        {
            throw new NotFoundException;
        }

        return $model;
    }
1079743
public function getEntityById($entity, $id, $cols = null)
    {
        $tbl = $this->_resource->getTableName($entity);
        /* columns to select */
        $cols = ($cols) ? $cols : '*';
        $query = $this->_conn->select();
        $query->from($tbl, $cols);
        foreach (array_keys($id) as $field) {
            $query->where("`$field`=:$field");
        }
        $result = $this->_conn->fetchRow($query, $id);
        return $result;
    }
1294984
public function findOrFail($id)
    {
        if ($model = $this->find($id)) {
            return $model;
        }
        throw (new ModelNotFoundException)->setModel(get_class($this->getModel()));
    }
938005
final public function findColumnByPk($id, $column)
    {
        $this->validateShortcutData();
        return $this->fetchOneColumn($column, $this->getPk(), $id);
    }
1287554
public function find($id, array $columns = ['*'])
    {
        if (is_array($id)) {
            return $this->findMany($id, $columns);
        }

        return $this->getBy($this->getModel()->getQualifiedKeyName(), $id, $columns);
    }
1247123
public function findOrNew($id, $columns = ['*'])
    {
        if (! is_null($model = $this->find($id, $columns))) {
            return $model;
        }

        return $this->newModelInstance();
    }
327780
public function findByUid($id, $columns = ['*'])
    {
        $this->applyCriteria();
        $this->applyScope();
        $model = $this->model->where('uid', '=', $id)->firstOrFail($columns);
        $this->resetModel();

        return $this->parserResult($model);
    }
1153805
def find(self, id, columns=None):
        
        if not columns:
            columns = ['*']

        return self.where('id', '=', id).first(1, columns)