Conditions | 3 |
Paths | 3 |
Total Lines | 21 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
13 | public function afterFind($results, $primary = false) { |
||
14 | foreach ($results as &$result) { |
||
15 | $apple = $this->Apple->find('first', array( |
||
16 | 'fields' => array( |
||
17 | 'Apple.id', |
||
18 | 'Apple.apple_id', |
||
19 | ), |
||
20 | 'contain' => array( |
||
21 | 'ParentApple' => array('fields' => array('id', 'name')), |
||
22 | ), |
||
23 | 'conditions' => array('Apple.id' => $result[$this->alias]['id']), |
||
24 | )); |
||
25 | |||
26 | if ($apple) { |
||
27 | $apple = $apple['Apple'] + $apple; |
||
28 | unset($apple['Apple']); |
||
29 | } |
||
30 | $result[$this->alias]['Apple'] = $apple; |
||
31 | } |
||
32 | return $results; |
||
33 | } |
||
34 | } |
||
35 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.