@@ 90-99 (lines=10) @@ | ||
87 | /** |
|
88 | * {@inheritdoc} |
|
89 | */ |
|
90 | public function hasOne($related, $foreignKey = null, $localKey = null) |
|
91 | { |
|
92 | $instance = $this->newRelatedInstance($related); |
|
93 | ||
94 | $foreignKey = $foreignKey ?: $this->getForeignKey(); |
|
95 | ||
96 | $localKey = $localKey ?: $this->getKeyName(); |
|
97 | ||
98 | return $this->newHasOne($instance->newQuery(), $this, $foreignKey, $localKey); |
|
99 | } |
|
100 | ||
101 | /** |
|
102 | * {@inheritdoc} |
|
@@ 104-113 (lines=10) @@ | ||
101 | /** |
|
102 | * {@inheritdoc} |
|
103 | */ |
|
104 | public function hasMany($related, $foreignKey = null, $localKey = null) |
|
105 | { |
|
106 | $instance = $this->newRelatedInstance($related); |
|
107 | ||
108 | $foreignKey = $foreignKey ?: $this->getForeignKey(); |
|
109 | ||
110 | $localKey = $localKey ?: $this->getKeyName(); |
|
111 | ||
112 | return $this->newHasMany($instance->newQuery(), $this, $foreignKey, $localKey); |
|
113 | } |
|
114 | ||
115 | /** |
|
116 | * {@inheritdoc} |