PHP Class SQL_Relation, atk4

Inheritance: extends AbstractModel
Datei anzeigen 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_oe property

public $delete_behaviour

$dsql public_oe property

public $dsql

$expr public_oe property

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

$f1 public_oe property

public $f1

$f2 public_oe property

Using expression when joining
public $f2

$fa public_oe property

Master field
public $fa

$id public_oe property

public $id

$m1 public_oe property

short name / field alias ?
public $m1

$m2 public_oe property

Foreign field
public $m2

$owner public_oe property

public SQL_Model $owner
return SQL_Model

$relation public_oe property

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

$t public_oe property

short_name = Foreign alias
public $t

$table_alias public_oe property

cascade, setnull, ignore
public $table_alias