refactor relations
[m6w6/pq-gateway] / lib / pq / Gateway / Table / Reference.php
1 <?php
2
3 namespace pq\Gateway\Table;
4
5 /**
6 * Foreign key
7 */
8 class Reference
9 {
10 /**
11 * @var string
12 */
13 public $name;
14
15 /**
16 * @var string
17 */
18 public $foreignTable;
19
20 /**
21 * @var string
22 */
23 public $foreignColumn;
24
25 /**
26 * @var string
27 */
28 public $referencedTable;
29
30 /**
31 * @var string
32 */
33 public $referencedColumn;
34
35 /**
36 * @param array $state
37 */
38 function __construct($state) {
39 $this->name = $state["name"];
40 $this->foreignColumn = $state["foreignColumn"];
41 $this->foreignTable = $state["foreignTable"];
42 $this->referencedColumn = $state["referencedColumn"];
43 $this->referencedTable = $state["referencedTable"];
44 }
45
46 /**
47 * @param array $state
48 * @return \pq\Gateway\Table\Reference
49 */
50 static function __set_state($state) {
51 return new static($state);
52 }
53 }