This class is an object response of every model call

package OWR
subpackage Model

 Methods

Public constructor

__construct(array $contents) 
author Pierre-Alain Mignot
access public

Parameters

$contents

array

the contents of the response (status, do, errors, etc..)

Returns a JSON object of $this

__toString() : string
author Pierre-Alain Mignot
access public

Returns

stringJSON equivalent of $this

Returns $this->_datas

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

Returns

arraythe datas if any

Returns $this->_error

getError() : string
author Pierre-Alain Mignot
access public

Returns

stringthe error if any

Returns $this->_errors

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

Returns

arraythe errors if any

Returns $this->_location

getLocation() : string
author Pierre-Alain Mignot
access public

Returns

stringthe location to redirect to

Returns $this->_do

getNext() : string
author Pierre-Alain Mignot
access public

Returns

stringthe action to do now

Returns $this->_status

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

Returns

intthe status

Returns $this->_tpl

getTpl() : string
author Pierre-Alain Mignot
access public

Returns

stringthe tpl to render

Returns $this->_multiple

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

Returns

booleantrue if more than one row is in $this->_datas

 Properties

 

datas for page rendering, only for do=(ok|error)

$_datas : array
access protected
 

what do we do next ? Can be ok, error, redirect

$_do : string
access protected
 

an error to log

$_error : string
access protected
 

list of eventual errors Used for displaying errors to user

$_errors : array
access protected
 

if $this->_do is set to redirect, then we can give an url to location

$_location : string
access protected
 

true if the model returns datas and if it contains more than one row

$_multiple : boolean
access protected
 

Status of the the response This code is based on HTTP status code BUT can be different

$_status : int
access protected
 

tpl name of the template if we must render one

$_tpl : string
access protected