Source API for the «PorteTypes_Base» class

Abstract class which type classes may extends to get functionnalities.

Public static methods

sanitize

This method is not yet documented.

fromDb

Store a value retrieve from the database to the internal record store.

return
PorteRecord
Current record
$property
string, Model
property
$record
PorteRecord, Record
to work on
$value
string, Value
returned by the sql query
get

Return the value of a record property as a string.

return
string
Value associated with the property
string
$property, Property
of the record
PorteRecord
$record, Record
on which to get the property
set

Set a value to the record store and also honore "null_if" and "default_if" model configuration.

Options may include:

- null_if: set the value to null if value match
- default_if: set the value to the default value match
return
PorteRecord
Provided record
Property
$property, to
set
PorteRecord
$record, Record
on which to set the property
mixed
$value, Value
to set
array
$options, mixed
Value to set
tableUpdate

This method is not yet documented.

hasChanged

Check if a property value has been modified.

The method is only called if a record is not new and if the property is present in "_data.user".

If the record is not yet loaded, we return true without loading it.

return
boolean
True if the property has been modified
$property
string
$record
PorteRecord
save

Update the record data state and enrich the property to value array used to build the SQL query in insert and update.

toDb

Return the property and the value prepared for SQL query integration in insert and update.

fromArray

This method is not yet documented.

toArray

This method is not yet documented.