This object represents a result from DB

uses convert everything to an object
uses the exceptions handler
package OWR
subpackage DB
used_by \OWR\DAO
used_by \OWR\Model
used_by \OWR\DB

 Methods

Constructor

__construct(\PDOStatement $stmt, int $type) 
access public
author Pierre-Alain Mignot

Parameters

$stmt

\OWR\DB\PDOStatement

the PDOStatement

$type

int

the fetch type

Getter of unexisting var

__get(string $var) : null
Inherited
access public
author Pierre-Alain Mignot
inherited_from \OWR\Object::__get()

Parameters

$var

string

the var name

Returns

null

Setter of unexisting var

__set(string $var, mixed $value) : boolean
Inherited
access public
author Pierre-Alain Mignot
inherited_from \OWR\Object::__set()

Parameters

$var

string

the var name

$value

mixed

the value to set

Returns

booleantrue

Executed when this object is used as a string

__toString() : string
Inherited
access public
author Pierre-Alain Mignot
inherited_from \OWR\Object::__toString()

Returns

stringthis object serialized

Returns public properties of current object as an associative array

asArray() : array
Inherited
access public
inherited_from \OWR\Object::asArray()

Returns

arraythe result

Returns the number of rows

count() : int
access public
author Pierre-Alain Mignot

Returns

intthe number of rows

Getter Can be used to get multidimensional values

get(string $var) : mixed
Inherited
access public
author Pierre-Alain Mignot
inherited_from \OWR\Object::get()

Parameters

$var

string

the var name

Returns

mixedthe var if exists, or null

Returns all the next rows

getAllNext() : array
access public
author Pierre-Alain Mignot

Returns

arraythe next rows

Sets the next row into $this

next() : boolean
access public
author Pierre-Alain Mignot

Returns

booleantrue on success

Abstract function to sanitize

sanitize(mixed $datas) : mixed
Inherited
access public
abstract
author Pierre-Alain Mignot
inherited_from \OWR\Object::sanitize()

Parameters

$datas

mixed

the datas to sanitize

Returns

mixed?

Setter Can be used to get multidimensional values

set(string $var, mixed $value) : mixed
Inherited
access public
author Pierre-Alain Mignot
inherited_from \OWR\Object::set()

Parameters

$var

string

the var name

$value

mixed

the value to assign to $var

Returns

mixedthe value

Returns public properties of object passed by parameter as an associative array or return an array of multidimensional array

toArray(mixed $object) : array
InheritedStatic
access public
static
inherited_from \OWR\Object::toArray()

Parameters

$object

mixed

the object to convert

Returns

arraythe result

Getter Can be used to get multidimensional values

_setDatas(array $datas) : boolean
Inherited
access public
author Pierre-Alain Mignot
inherited_from \OWR\Object::_setDatas()

Parameters

$datas

array

the datas to set to $this

Returns

booleantrue

 Properties

 

store the results

$_rows : array
access private

 Constants

 

<p>fetch type (all results)</p>

FETCH_ALL : int
 

<p>fetch type (first row)</p>

FETCH_ONE : int
 

<p>fetch type (rows)</p>

FETCH_ROW : int