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 | |||
56 | 28 | public function setOptions($options) { |
|
59 | |||
60 | public function getOptions() { |
||
63 | |||
64 | /** |
||
65 | * Gets an instance of the related model accessed through this class. |
||
66 | * @return RecordWrapper |
||
67 | */ |
||
68 | 12 | public function getModelInstance() { |
|
75 | |||
76 | 28 | public function setup($name, $schema, $table, $primaryKey) { |
|
82 | |||
83 | abstract public function getQuery($data); |
||
84 | |||
85 | abstract public function runSetup(); |
||
86 | } |
||
87 |
For interface and abstract methods, it is impossible to infer the return type from the immediate code. In these cases, it is generally advisible to explicitly annotate these methods with a
@return
doc comment to communicate to implementors of these methods what they are expected to return.