src/Koldy/Db/Query/Select.php
public function fetchFirst(): ?array
    {
        if (!$this->wasExecuted()) {
            $this->exec();
        }

        $this->resetLimit()->limit(0, 1);
        $results = $this->fetchAll();
        return isset($results[0]) ? $results[0] : null;
    }
public function fetchFirst(): ?array
    {
        if (!$this->wasExecuted()) {
            $this->exec();
        }

        $this->resetLimit()->limit(0, 1);
        $results = $this->fetchAll();
        return isset($results[0]) ? $results[0] : null;
    }
public function fetchFirst ( ) : ? array { if ( ! $ this -> wasExecuted ( ) ) { $ this -> exec ( ) ; } $ this -> resetLimit ( ) -> limit ( 0 , 1 ) ; $ results = $ this -> fetchAll ( ) ; return isset ( $ results [ 0 ] ) ? $ results [ 0 ] : null ; }
Fetch only first record as object or return null if there is no records
@return array|null
@throws Exception
@throws \Koldy\Exception
Fetch only first record as object or return null if there is no records