public function load($constraint) { $res = parent::load($constraint); $path = DATA_ROOT . 'tmp/'; $file = new File($path); $image = $this->image; if (!empty($image)) { $file->load($this->image); if ($file === false) { throw new Exception('Failed to load file for ' . get_class($this) . ' with id ' . $this->image); } $a = $file->Pull($this->image_width, $this->image_height); $this->image_filename = '/data/tmp/' . $a['filename']; } return $res; }