PHP 클래스 TORM\Model

PHP version 5.5
저자: Eustáquio Rangel ([email protected])
상속: use trait torm\Finders, use trait torm\Storage, use trait Persistence, use trait torm\Errors, use trait torm\Validations, use trait torm\Scopes, use trait HasMany, use trait torm\HasOne, use trait torm\BelongsTo, use trait Sequences, use trait Callbacks, use trait torm\Dirty
파일 보기 프로젝트 열기: taq/torm

공개 프로퍼티들

프로퍼티 타입 설명
$connection
$errors
$yaml_file

공개 메소드들

메소드 설명
__call ( string $method, mixed $args ) : null Trigger to use object values as methods Like $user->name("john doe"); echo $user->name();
__construct ( array $data = null ) Constructor
__get ( string $attr ) : attribute Trigger to get object values as attributes Like echo $user->name;
__set ( string $attr, mixed $value ) : null Trigger to set object values as attributes Like $user->name = "john doe";
closeCursor ( mixed $stmt ) : null Close cursor
closeCursorBehaviour ( mixed $action ) : null Behaviour to close cursor
executePrepared ( mixed $obj, mixed $values = [] ) : object Execute a prepared statement, trying to get it from cache.
extractColumns ( ) : string Extract table columns string
extractUpdateColumns ( mixed $values ) : string Extract update columns string
extractWhereConditions ( mixed $conditions ) : string Extract where conditions string Just used for testing, to avoid change the function name withou the underline on all code. This is something PHP should change.
extractWhereValues ( mixed $conditions ) : mixed Extract where values from conditions
get ( string $attr, boolean $current = true ) : mixed Get an attribute value
getColumns ( ) : mixed Return columns
getOrder ( ) : string Returns the default order.
getPK ( ) : string Returns the primary key column.
getReversedOrder ( ) : string Returns the inverse order.
getTableName ( string $cls = null ) : string Returns the table name.
hasColumn ( string $column ) : column Check if a column exists
isIgnoringCase ( ) : boolean Check if is ignoring case
is_new ( ) : boolean Tell if its a new object (not saved)
query ( string $sql ) : mixed Run a SQL query
reload ( ) : mixed Reload the current object
resolveConnection ( ) : object Resolve the current connection handle.
set ( string $attr, mixed $value ) : null Set an attribute value
setConnection ( mixed $con, string $env = "development" ) : null Sets a specific connection for the current model
setOrder ( string $order ) : null Set the default order
setPK ( string $pk ) : null Set the primary key column
setTableName ( string $table_name ) : null Set the model's table name

비공개 메소드들

메소드 설명
_checkLoaded ( ) : boolean Check if the object columns were loaded
_extractClassName ( $cls ) : string Extract namespace from class name
_extractWhereAssociativeConditions ( mixed $conditions, string $cls, string $escape ) : string Extract where conditions string, from an associative array
_extractWhereAssociativeValues ( mixed $conditions ) : mixed Extract values from an associative array
_extractWhereConditions ( mixed $conditions ) : string Extract where conditions string
_extractWhereRegularConditions ( mixed $conditions, string $cls, string $escape ) : string Extract where conditions string, from a regular array
_extractWhereRegularValues ( mixed $conditions ) : mixed Extract values from a regular array
_loadColumns ( ) : null Load column info
_loadNullValues ( ) : null Load null values on row columns. Useful to new objects.
_makeBuilder ( ) : mixed Create a query builder
_resolveRelations ( string $attr ) : null Resolve relations on an attribute, if present
_validateAfterInitialize ( ) : null Validate after initialize

메소드 상세

__call() 공개 메소드

Trigger to use object values as methods Like $user->name("john doe"); echo $user->name();
public __call ( string $method, mixed $args ) : null
$method string method
$args mixed arguments
리턴 null

__construct() 공개 메소드

If data is sent, then it loads columns with it.
public __construct ( array $data = null )
$data array to fill the object

__get() 공개 메소드

Trigger to get object values as attributes Like echo $user->name;
public __get ( string $attr ) : attribute
$attr string attribute
리턴 attribute value

__set() 공개 메소드

Trigger to set object values as attributes Like $user->name = "john doe";
public __set ( string $attr, mixed $value ) : null
$attr string attribute
$value mixed value
리턴 null

closeCursor() 공개 정적인 메소드

Close cursor
public static closeCursor ( mixed $stmt ) : null
$stmt mixed statement
리턴 null

closeCursorBehaviour() 공개 정적인 메소드

Behaviour to close cursor
public static closeCursorBehaviour ( mixed $action ) : null
$action mixed to use
리턴 null

executePrepared() 공개 정적인 메소드

Execute a prepared statement, trying to get it from cache.
public static executePrepared ( mixed $obj, mixed $values = [] ) : object
$obj mixed object
$values mixed to use
리턴 object statement

extractColumns() 공개 정적인 메소드

Extract table columns string
public static extractColumns ( ) : string
리턴 string columns

extractUpdateColumns() 공개 정적인 메소드

Extract update columns string
public static extractUpdateColumns ( mixed $values ) : string
$values mixed to set columns
리턴 string columns

extractWhereConditions() 공개 정적인 메소드

Extract where conditions string Just used for testing, to avoid change the function name withou the underline on all code. This is something PHP should change.
public static extractWhereConditions ( mixed $conditions ) : string
$conditions mixed to extract
리턴 string where conditions

extractWhereValues() 공개 정적인 메소드

Extract where values from conditions
public static extractWhereValues ( mixed $conditions ) : mixed
$conditions mixed to extract values
리턴 mixed $values

get() 공개 메소드

Get an attribute value
public get ( string $attr, boolean $current = true ) : mixed
$attr string attribute
$current boolean current value
리턴 mixed attribute value

getColumns() 공개 정적인 메소드

Return columns
public static getColumns ( ) : mixed
리턴 mixed columns

getOrder() 공개 정적인 메소드

If not specified, returns an empty string.
public static getOrder ( ) : string
리턴 string order

getPK() 공개 정적인 메소드

Returns the primary key column.
public static getPK ( ) : string
리턴 string primary key

getReversedOrder() 공개 정적인 메소드

If DESC is specified, returns ASC.
public static getReversedOrder ( ) : string
리턴 string order

getTableName() 공개 정적인 메소드

If not specified one, get the current class name and pluralize it.
public static getTableName ( string $cls = null ) : string
$cls string class name
리턴 string table name

hasColumn() 공개 정적인 메소드

Check if a column exists
public static hasColumn ( string $column ) : column
$column string to check
리턴 column key

isIgnoringCase() 공개 정적인 메소드

Check if is ignoring case
public static isIgnoringCase ( ) : boolean
리턴 boolean ignoring case

is_new() 공개 메소드

Tell if its a new object (not saved)
public is_new ( ) : boolean
리턴 boolean new or not

query() 공개 정적인 메소드

Run a SQL query
public static query ( string $sql ) : mixed
$sql string query
리턴 mixed result

reload() 공개 메소드

Reload the current object
public reload ( ) : mixed
리턴 mixed object

resolveConnection() 공개 정적인 메소드

Get it from PDO or from the current class.
public static resolveConnection ( ) : object
리턴 object connection

set() 공개 메소드

Set an attribute value
public set ( string $attr, mixed $value ) : null
$attr string attribute
$value mixed value
리턴 null

setConnection() 공개 정적인 메소드

Sets a specific connection for the current model
public static setConnection ( mixed $con, string $env = "development" ) : null
$con mixed PDO connection
$env string enviroment
리턴 null

setOrder() 공개 정적인 메소드

Set the default order
public static setOrder ( string $order ) : null
$order string default
리턴 null

setPK() 공개 정적인 메소드

Set the primary key column
public static setPK ( string $pk ) : null
$pk string primary key
리턴 null

setTableName() 공개 정적인 메소드

Set the model's table name
public static setTableName ( string $table_name ) : null
$table_name string table name
리턴 null

프로퍼티 상세

$connection 공개적으로 정적으로 프로퍼티

public static $connection

$errors 공개적으로 프로퍼티

public $errors

$yaml_file 공개적으로 정적으로 프로퍼티

public static $yaml_file