1 | <?php |
||
9 | class TableRelation |
||
10 | { |
||
11 | /** Relation type: one-to-many */ |
||
12 | const T_ONE_TO_MANY = 1; |
||
13 | /** Relation type: one-to-one */ |
||
14 | const T_ONE_TO_ONE = 0; |
||
15 | |||
16 | /** Collection of permanent instances of class */ |
||
17 | public static $instances = array(); |
||
18 | |||
19 | /** Parent table in relation */ |
||
20 | public $parent; |
||
21 | |||
22 | /** Child table in relation */ |
||
23 | public $child; |
||
24 | |||
25 | /** Parent table field name in relation */ |
||
26 | public $parent_field; |
||
27 | |||
28 | /** Child table field name in relation */ |
||
29 | public $child_field; |
||
30 | |||
31 | /** Alias for JOIN in relation */ |
||
32 | public $alias; |
||
33 | |||
34 | /** Relation type */ |
||
35 | public $type; |
||
36 | |||
37 | /** |
||
38 | * Constructor |
||
39 | * |
||
40 | * @param string $p Parent table name |
||
41 | * @param string $c Child table name |
||
42 | * @param string $pf Parent field name |
||
43 | * @param integer $rt Relation type |
||
44 | * @param string $cf Child field name |
||
45 | * @param string $a Alias |
||
46 | */ |
||
47 | public function __construct( $p, $c, $pf = null, $rt = self::T_ONE_TO_ONE, $cf = null, $a = null ) |
||
71 | } |