Basecoat\DB::selectAll PHP Метод

selectAll() публичный Метод

Run a SELECT query with optional data binding values, and retrieves ALL rows This will use a separate statement handle so other outstanding queries do not get overwritten
public selectAll ( string $query, array $bindings = null, boolean $useMaster = false ) : mixed
$query string SQL Select query to run
$bindings array array of values to bind to the query. Can be an associative array to bind by name
$useMaster boolean set to TRUE to use the master server connection
Результат mixed returns associative array of data on success, negative int on failure
    public function selectAll($query, $bindings = null, $useMaster = false)
    {
        // Save current statement handle
        if ($useMaster) {
            $sth = self::$msth;
            self::$msth = null;
        } else {
            $sth = $this->sth;
            $this->sth = null;
        }
        $qresult = $this->select($query, $bindings, $useMaster, true);
        // Restore previous statement handle
        if ($useMaster) {
            self::$msth = $sth;
        } else {
            $this->sth = $sth;
        }
        if ($qresult > 0) {
            return $this->selectResult;
        } else {
            return $qresult;
        }
    }