@@ -9,5 +9,8 @@ |
||
9 | 9 | */ |
10 | 10 | interface ModelJoinerInterface |
11 | 11 | { |
12 | + /** |
|
13 | + * @return string |
|
14 | + */ |
|
12 | 15 | public function getJunctionClassName($classA, $classB); |
13 | 16 | } |
@@ -46,11 +46,11 @@ |
||
46 | 46 | public function runSetup() |
47 | 47 | { |
48 | 48 | $model = InjectionContainer::resolve(Nibii::getClassName($this->options['model'], self::BELONGS_TO)); |
49 | - if($this->options['foreign_key'] == null) { |
|
49 | + if ($this->options['foreign_key'] == null) { |
|
50 | 50 | $this->options['foreign_key'] = $model->getDescription()->getPrimaryKey()[0]; |
51 | 51 | } |
52 | - if($this->options['local_key'] == null) { |
|
53 | - $this->options['local_key'] = Text::singularize($model->getTable()) . '_id'; |
|
52 | + if ($this->options['local_key'] == null) { |
|
53 | + $this->options['local_key'] = Text::singularize($model->getTable()).'_id'; |
|
54 | 54 | } |
55 | 55 | } |
56 | 56 | } |