1 | <?php |
||
29 | abstract class Relationship { |
||
30 | |||
31 | const BELONGS_TO = 'BelongsTo'; |
||
32 | const HAS_MANY = 'HasMany'; |
||
33 | const MANY_HAVE_MANY = 'ManyHaveMany'; |
||
34 | |||
35 | protected $options = []; |
||
36 | protected $type; |
||
37 | protected $setupName; |
||
38 | protected $setupTable; |
||
39 | protected $setupSchema; |
||
40 | protected $setupPrimaryKey; |
||
41 | |||
42 | /** |
||
43 | * |
||
44 | * @var \ntentan\panie\Container |
||
45 | */ |
||
46 | protected $container; |
||
47 | |||
48 | /** |
||
49 | * |
||
50 | * @var ORMContext |
||
51 | */ |
||
52 | protected $context; |
||
53 | |||
54 | private $setup = false; |
||
55 | private $query; |
||
56 | protected $queryPrepared = false; |
||
57 | |||
58 | 28 | public function setOptions($options) { |
|
61 | |||
62 | 12 | public function getQuery() { |
|
68 | |||
69 | public function getOptions() { |
||
72 | |||
73 | /** |
||
74 | * Gets an instance of the related model accessed through this class. |
||
75 | * @return RecordWrapper |
||
76 | */ |
||
77 | 12 | public function getModelInstance() { |
|
84 | |||
85 | 28 | public function setup($name, $schema, $table, $primaryKey) { |
|
91 | |||
92 | abstract public function prepareQuery($data); |
||
93 | |||
94 | abstract public function runSetup(); |
||
95 | } |
||
96 |
Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a
@return
annotation as described here.