Airship\Engine\Database::single PHP Méthode

single() public méthode

Fetch a single result -- useful for SELECT COUNT() queries
public single ( string $statement, array $params = [] ) : mixed
$statement string
$params array
Résultat mixed
    public function single(string $statement, array $params = [])
    {
        if (!\is1DArray($params)) {
            throw new \TypeError(\trk('errors.database.array_passed'));
        }
        $stmt = $this->pdo->prepare($statement);
        $stmt->execute($params);
        return $stmt->fetchColumn(0);
    }