Select a row by id from this table

@param $id

@return array|null
@throws DatabaseException
424903
public function getById($id)
    {
        $sql = "SELECT * FROM " . $this->getTable() . " WHERE " . $this->getPrimaryKey() . " = " . intval($id) . ";";

        try {
            $result = $this->db->query($sql);
        } catch (\PDOException $e) {
            throw new DatabaseException($e->getMessage() . '<br>' . $sql);
        }
        return $this->fetchAssoc($result);

    }
338462
public function findById($id)
    {
        $queryBuilder = $this->createQueryBuilder('a')
            ->addSelect('domains')
            ->leftJoin('a.domains', 'domains')
            ->where('a.id = :id');

        $query = $queryBuilder->getQuery();
        $query->setParameter('id', $id);

        return $query->getSingleResult();
    }
714080
public function find($id)
    {
        return $this
            ->getQueryBuilder()
            ->andWhere($this->getAlias().'.id = '.intval($id))
            ->getQuery()
            ->getOneOrNullResult()
        ;
    }
266310
public function fetchById($id) {
        $select = $this->select()->where('id = ?', $id);
        return $this->fetchRow($select);
    }
630121
public function read($id)
    {
        try {
            $result = $this->db->from($this->table)
                ->where($this->columns['id'])->eq($id)
                ->column($this->columns['data']);

            return $result === false ? '' : $result;
        } catch (PDOException $e) {
            return '';
        }
    }
805995
public function read($id)
	{
		$tableName = $this->db->parseField($this->tableName);
		$sessionID = $this->db->parseField('session_id');
		$result = $this->db->query(<<<SQL
select * from {$tableName} where {$sessionID} = %s
SQL
,array($id));
		if(isset($result['data']))
		{
			return $result['data'];
		}
		else
		{
			return '';
		}
	}
397152
public function getRow($id = null)
    {
        if ($this->isDetached) {
            if ($id !== null) {
                throw new InvalidArgumentException('Argument $id in Result::getRow method cannot be passed when Result is in detached state.');
            }
            $id = self::DETACHED_ROW_ID;
        } elseif ($id === null) {
            throw new InvalidArgumentException('Argument $id in Result::getRow method must be passed when Result is in attached state.');
        }
        if (!isset($this->data[$id])) {
            return null;
        }
        return new Row($this, $id);
    }
995790
public function getRowFromId($id)
    {
        if (!isset($this->rows[$id])) {
            if ($id == self::ID_SUMMARY_ROW
                && !is_null($this->summaryRow)
            ) {
                return $this->summaryRow;
            }
            return false;
        }
        return $this->rows[$id];
    }
754741
public function delete($id = null)
    {
        // If an ID is passed to the method, we will set the where clause to check
        // the ID to allow developers to simply and quickly remove a single row
        // from their database without manually specifying the where clauses.
        if (!is_null($id)) {
            $this->where('id', '=', $id);
        }
        $this->compileWheres();

        return $this->query->delete()->run();
    }
115885
public function delete(string $id)
    {
        $this->request->allowMethod(['post', 'delete']);
        $dblist = $this->Dblists->get($id);
        if ($this->Dblists->delete($dblist)) {
            $this->Flash->success('The database list has been deleted.');
        } else {
            $this->Flash->error('The database list could not be deleted. Please, try again.');
        }

        return $this->redirect(['action' => 'index']);
    }
371081
public function getById($id)
    {
        $query = $this->createQuery();
        $query->where(
            $query->buildAndSet([$this->getModel()->getTableKey(), '=', $id])
        );
        $result = $this->database->query($query);

        $model = null;
        if ($result) {
            $result = $result->fetchAll(\PDO::FETCH_ASSOC);
            $entities = $this->handleResult($result);
            $model = current($entities);
        }
        return $model;
    }
549701
public function selectAction($id)
    {
        $instance = $this->getManager()->find($id);
        // If instance exists
        if($instance) {
            $this->getRequest()->getSession()->set('instance', $instance);
            if($this->getWorker()) {
                $this->get('session')->getFlashBag()->add('success', 'Instance '.$instance->getName().' selected');
            }else {
                $this->get('session')->getFlashBag()->add('error', 'Instance '.$instance->getName().' cannot be selected');
            }
        }else {
            $this->get('session')->getFlashBag()->add('error', 'This instance does not exist');
        }
        
        return new RedirectResponse($this->generateUrl('ringo_php_redmon'));
    }
89780
public function filterId($id)
    {
        if (1 === count($this->data)) {
            return array_shift($this->data);
        }

        $result = $this->filter(
            function ($key, $value) use ($id) {
                if ($value->getId() == $id) {
                    return true;
                }
            }
        );

        if (!count($result)) {
            return null;
        }

        $collection = $result->getAll();

        return array_shift($collection);
    }
1216046
public function getById($id)
    {
        $this->_db->query(
            'SELECT * FROM '.$this->_dbConfig['table']
                          .' WHERE '.$this->_dbConfig['id'].' = :id',
            [':id'=>$id]
        );
        $row = $this->_db->result();
        if (isset($row[0])) {
            $row = $row[0]->getAll();

            $this->_login = true; //Setando LOGIN como válido/logado

            foreach ($this->_data as $i => $d) {
                if (isset($row[$this->_dbConfig[$i]])) {
                    $this->_data[$i] = $row[$this->_dbConfig[$i]];
                }
            }
            return $this->_data;
        }
        return false;
    }
1140786
public function delete($id = null)
    {
        if (! is_null($id)) $this->where('id', '=', $id);

        $sql = $this->grammar->compileDelete($this);

        return $this->connection->delete($sql, $this->getBindings());
    }
592266
public function delete($id = null)
    {
        // If an ID is passed to the method, we will set the where clause to check the
        // ID to let developers to simply and quickly remove a single row from this
        // database without manually specifying the "where" clauses on the query.
        if (! is_null($id)) {
            $this->where($this->from.'.id', '=', $id);
        }

        return $this->connection->delete(
            $this->grammar->compileDelete($this), $this->cleanBindings(
                $this->grammar->prepareBindingsForDelete($this->bindings)
            )
        );
    }
756471
public static function delete($id)
    {
        DB::nonQuery('DELETE FROM `%s` WHERE `%s` = %u', [
            static::$tableName,
            static::_cn(static::$primaryKey ? static::$primaryKey : 'ID'),
            $id,
        ], [static::class,'handleError']);

        return DB::affectedRows() > 0;
    }