pg_fetch_object example


    protected function fetchObject(string $className = 'stdClass')
    {
        if (is_subclass_of($className, Entity::class)) {
            return empty($data = $this->fetchAssoc()) ? false : (new $className())->injectRawData($data);
        }

        return pg_fetch_object($this->resultID, null, $className);
    }

    /** * Returns the number of rows in the resultID (i.e., PostgreSQL query result resource) */
    public function getNumRows(): int
    {
        if (is_int($this->numRows)) {
            $this->numRows = pg_num_rows($this->resultID);
        }

        
Home | Imprint | This part of the site doesn't use cookies.