Conditions | 6 |
Paths | 7 |
Total Lines | 21 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
16 | public function getImageUrl($attr, $tmb = false) |
||
17 | { |
||
18 | foreach ($this->behaviors as $behavior) { |
||
19 | if ($behavior instanceof Behavior) { |
||
20 | return $behavior->getImageUrl($attr, $tmb); |
||
21 | } |
||
22 | } |
||
23 | |||
24 | $class = new \ReflectionClass($this); |
||
25 | $class = 'backend\models\\' . $class->getShortName(); |
||
26 | if (class_exists($class)) { |
||
27 | $model = new $class; |
||
28 | foreach ($model->behaviors as $behavior) { |
||
29 | if ($behavior instanceof Behavior) { |
||
30 | return $behavior->getImageUrl($attr, $tmb, $this); |
||
31 | } |
||
32 | } |
||
33 | } |
||
34 | |||
35 | return null; |
||
36 | } |
||
37 | } |
||
38 |