PHP 클래스 ORMWrapper, paris

You shouldn't need to interact with this class directly. It is used internally by the Model base class.
상속: extends ORM
파일 보기 프로젝트 열기: j4mie/paris 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$_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