Total Complexity | 6 |
Total Lines | 36 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
14 | class DActiveRecord extends ActiveRecord |
||
15 | { |
||
16 | /** in case we would need to customize stuff */ |
||
17 | |||
18 | /** |
||
19 | * Get the primary key column as string if the one-column PK |
||
20 | * NB! Always use single column Primary-keys! |
||
21 | * @return string |
||
22 | * @throws NotSupportedException if multi-column PrimaryKey is used |
||
23 | */ |
||
24 | public static function primaryKeySingle() |
||
30 | } |
||
31 | |||
32 | |||
33 | |||
34 | /** {@inheritdoc} */ |
||
35 | public function hasMany($class, $link = null) |
||
36 | { |
||
37 | if (empty($link)) { |
||
38 | $link = [static::primaryKeySingle() => static::primaryKeySingle()]; |
||
39 | } |
||
40 | return parent::hasMany($class, $link); |
||
41 | } |
||
42 | |||
43 | /** {@inheritdoc} */ |
||
44 | public function hasOne($class, $link = null) |
||
50 | } |
||
51 | } |