PHP Класс ORMWrapper, paris

You shouldn't need to interact with this class directly. It is used internally by the Model base class.
Наследование: extends ORM
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$_class_name string The wrapped find_one and find_many classes will return an instance or instances of this class.

Открытые методы

Метод Описание
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.

Защищенные методы

Метод Описание
_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.

Описание методов

_create_model_instance() защищенный Метод

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
Результат boolean | Model

create() публичный Метод

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
Результат ORMWrapper | boolean

filter() публичный Метод

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
Результат ORMWrapper

find_many() публичный Метод

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
Результат Array

find_one() публичный Метод

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
Результат Model

for_table() публичный статический Метод

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
Результат ORMWrapper

set_class_name() публичный Метод

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
Результат void

Описание свойств

$_class_name защищенное свойство

The wrapped find_one and find_many classes will return an instance or instances of this class.
protected string $_class_name
Результат string