PHP Class SQL_Relation, atk4

Inheritance: extends AbstractModel
Show file Open project: atk4/atk4

Public Properties

Property Type Description
$delete_behaviour
$dsql
$expr Join kind (left|right|inner|cross etc.)
$f1
$f2 Using expression when joining
$fa Master field
$id
$m1 short name / field alias ?
$m2 Foreign field
$owner SQL_Model
$relation $m1 == $relation->f1
$t short_name = Foreign alias
$table_alias cascade, setnull, ignore

Public Methods

Method Description
addField ( $n, $actual_field = null ) Second argument to addField() will specify how the field is really called
afterDelete ( $m )
afterInsert ( $m, $id )
afterLoad ( $m )
afterUnload ( $m )
beforeDelete ( $m, $id )
beforeInsert ( $m, $q )
beforeLoad ( $m, $q = null ) Add query for the relation's ID, but then remove it from results. Remove ID when unloading.
beforeModify ( $m, $q )
beforeSave ( $m )
fieldExpr ( $f )
hasMany ( $model, $their_field = null, $our_field = null, $as_field = null )
hasOne ( $model, $our_field = null, $display_field = null )
init ( ) }}}
join ( $foreign_table, $master_field = null, $join_kind = null, $_foreign_alias = null )
leftJoin ( $foreign_table, $master_field = null, $join_kind = null, $_foreign_alias = null )
set ( $foreign_table, $master_field = null, $join_kind = null, $relation = null ) TODO: hasMany()

Method Details

addField() public method

Second argument to addField() will specify how the field is really called
public addField ( $n, $actual_field = null )

afterDelete() public method

public afterDelete ( $m )

afterInsert() public method

public afterInsert ( $m, $id )

afterLoad() public method

public afterLoad ( $m )

afterUnload() public method

public afterUnload ( $m )

beforeDelete() public method

public beforeDelete ( $m, $id )

beforeInsert() public method

public beforeInsert ( $m, $q )

beforeLoad() public method

Add query for the relation's ID, but then remove it from results. Remove ID when unloading.
public beforeLoad ( $m, $q = null )

beforeModify() public method

public beforeModify ( $m, $q )

beforeSave() public method

public beforeSave ( $m )

fieldExpr() public method

public fieldExpr ( $f )

hasMany() public method

public hasMany ( $model, $their_field = null, $our_field = null, $as_field = null )

hasOne() public method

public hasOne ( $model, $our_field = null, $display_field = null )

init() public method

}}}
public init ( )

join() public method

public join ( $foreign_table, $master_field = null, $join_kind = null, $_foreign_alias = null )

leftJoin() public method

public leftJoin ( $foreign_table, $master_field = null, $join_kind = null, $_foreign_alias = null )

set() public method

TODO: hasMany()
public set ( $foreign_table, $master_field = null, $join_kind = null, $relation = null )

Property Details

$delete_behaviour public property

public $delete_behaviour

$dsql public property

public $dsql

$expr public property

Join kind (left|right|inner|cross etc.)
public $expr

$f1 public property

public $f1

$f2 public property

Using expression when joining
public $f2

$fa public property

Master field
public $fa

$id public property

public $id

$m1 public property

short name / field alias ?
public $m1

$m2 public property

Foreign field
public $m2

$owner public property

public SQL_Model $owner
return SQL_Model

$relation public property

$m1 == $relation->f1
public $relation

$t public property

short_name = Foreign alias
public $t

$table_alias public property

cascade, setnull, ignore
public $table_alias