03.27
php
saved
jonnyr
Note
afterFind() is causing infinite recursion as getFilePath() performs a field() lookup.
afterFind() is causing infinite recursion as getFilePath() performs a field() lookup.
- function afterFind($results)
- {
- {
- // Will cause the recursion.
- $results[$i]['Media']['path'] = $this->getFilePath();
- }
- }
- // Look up Absolute Path to file based on Project Model.
- public function getFilePath()
- {
- // triggers afterFind() again, infinite loop time
- $this->Project->id = $this->field('project_id');
- return Configure::read('mediamanager.storage_dir').$this->Project->getStoragePath().$this->getFilename();
- }
Parsed in 0.025 seconds, using GeSHi 1.0.7.14