spoof
 All Data Structures Namespaces Files Functions Variables Pages
Value Class Reference
Inheritance diagram for Value:
Collaboration diagram for Value:

Public Member Functions

 __construct ($value, $type)
 getType ()
 getValue ()

Data Fields

const TYPE_NULL = -1
const TYPE_STRING = 1
const TYPE_INTEGER = 2
const TYPE_FLOAT = 3
const TYPE_BOOLEAN = 4
const TYPE_BINARY = 5
const TYPE_ARRAY = 6
const TYPE_COLUMN = 7
const TYPE_PREPARED = 8
const TYPE_FUNCTION = 9

Protected Attributes

 $type
 $value

Detailed Description

A database value class implementation


Constructor & Destructor Documentation

__construct (   $value,
  $type 
)

Constructor creates an instance with specified type and value. Type must match the actual type of the value parameter. This object will not explicitly cast the type.

Parameters:
$valuemixed value of the object
$typeint type of the value
Exceptions:
DBValueInvalidExceptionwhen specified type and actual type do not match
DBValueTypeUnknownExceptionwhen invalid type is supplied

NOTE use of gettype is not recommended in PHP to determine types. We use it only to provide information in exceptions.

NOTE this is only valid for PHP >= 6

Implements IValue.


Member Function Documentation

getType ( )

Returns the value type

Returns:
integer value type

Implements IValue.

getValue ( )

Returns value

Returns:
mixed value

Implements IValue.


Field Documentation

$type
protected

Protected value type property

$value
protected

Protected value property

const TYPE_ARRAY = 6

Database value type array

const TYPE_BINARY = 5

Database value type binary

const TYPE_BOOLEAN = 4

Database value type boolean

const TYPE_COLUMN = 7

Database value type column

const TYPE_FLOAT = 3

Database value type float

const TYPE_FUNCTION = 9

Database value type function

const TYPE_INTEGER = 2

Database value type integer

const TYPE_NULL = -1

Database value type null

const TYPE_PREPARED = 8

Database value type prepared

const TYPE_STRING = 1

Database value type string


The documentation for this class was generated from the following file: