PHP Class ORMWrapper, paris

You shouldn't need to interact with this class directly. It is used internally by the Model base class.
Inheritance: extends ORM
Afficher le fichier Open project: j4mie/paris Class Usage Examples

Protected Properties

Свойство Type Description
$_class_name string The wrapped find_one and find_many classes will return an instance or instances of this class.

Méthodes publiques

Méthode Description
create ( $data = null ) : ORMWrapper | boolean Wrap Idiorm's create method to return an empty instance of the class associated with this wrapper instead of the raw ORM class.
filter ( ) : ORMWrapper Add a custom filter to the method chain specified on the model class. This allows custom queries to be added to models. The filter should take an instance of the ORM wrapper as its first argument and return an instance of the ORM wrapper. Any arguments passed to this method after the name of the filter will be passed to the called filter function as arguments after the ORM class.
find_many ( ) : Array Wrap Idiorm's find_many method to return an array of instances of the class associated with this wrapper instead of the raw ORM class.
find_one ( null | integer $id = null ) : Model Wrap Idiorm's find_one method to return an instance of the class associated with this wrapper instead of the raw ORM class.
for_table ( string $table_name, string $connection_name = parent::DEFAULT_CONNECTION ) : ORMWrapper Factory method, return an instance of this class bound to the supplied table name.
set_class_name ( string $class_name ) : void Set the name of the class which the wrapped methods should return instances of.

Méthodes protégées

Méthode Description
_create_model_instance ( ORM $orm ) : boolean | Model Method to create an instance of the model class associated with this wrapper and populate it with the supplied Idiorm instance.

Method Details

_create_model_instance() protected méthode

Method to create an instance of the model class associated with this wrapper and populate it with the supplied Idiorm instance.
protected _create_model_instance ( ORM $orm ) : boolean | Model
$orm ORM
Résultat boolean | Model

create() public méthode

Wrap Idiorm's create method to return an empty instance of the class associated with this wrapper instead of the raw ORM class.
public create ( $data = null ) : ORMWrapper | boolean
Résultat ORMWrapper | boolean

filter() public méthode

Add a custom filter to the method chain specified on the model class. This allows custom queries to be added to models. The filter should take an instance of the ORM wrapper as its first argument and return an instance of the ORM wrapper. Any arguments passed to this method after the name of the filter will be passed to the called filter function as arguments after the ORM class.
public filter ( ) : ORMWrapper
Résultat ORMWrapper

find_many() public méthode

Wrap Idiorm's find_many method to return an array of instances of the class associated with this wrapper instead of the raw ORM class.
public find_many ( ) : Array
Résultat Array

find_one() public méthode

Wrap Idiorm's find_one method to return an instance of the class associated with this wrapper instead of the raw ORM class.
public find_one ( null | integer $id = null ) : Model
$id null | integer
Résultat Model

for_table() public static méthode

A repeat of content in parent::for_table, so that created class is ORMWrapper, not ORM
public static for_table ( string $table_name, string $connection_name = parent::DEFAULT_CONNECTION ) : ORMWrapper
$table_name string
$connection_name string
Résultat ORMWrapper

set_class_name() public méthode

Set the name of the class which the wrapped methods should return instances of.
public set_class_name ( string $class_name ) : void
$class_name string
Résultat void

Property Details

$_class_name protected_oe property

The wrapped find_one and find_many classes will return an instance or instances of this class.
protected string $_class_name
Résultat string