Source API for the «PorteModels» class

Central class to store and manage all the models (instances of PorteModel).

PHP magic methods

__construct

This method is not yet documented.

__isset

Overwritte PHP magick "__isset" method to determine if a model is registered.

__get

Overwritte PHP magick "__get" method to retreive a model for a given type.

Public methods

get

Return a model based an a provided record or record type.

This method will try to determine the type of the model, and if already loaded, will return the model from internal cache.
If a model for a given type is not found, the record class is derived the camel case form of the type.

Options may include the following keys:

	no_exception If true, return boolean false instead of throwing an exception
return
mixed
PorteModel if model is found or boolean false if option 'no_exception' is present
PorteRecord
$arg, ||
String Record or record type
set

Register a new model into the internal cache.

Note, calling the set method won't sanitize the model. This action will be done the first time the model is requested. Calling multiple time the set method while the model is not yet sanitized will merge the provided config while calling the set model after it has been sanitized will overwrite the existing configuration.

return
PorteModels
The current model manager.
mixed
$arg, A
string representing the type or an record which class extends PorteRecord.
sanitize

This method is not yet documented.

keys

Retrieve all the registered models

return
array
Registered models.
toArray

Retrieve all the registered models

return
array
Registered models.