/** * Get all the results of the query built using the options passed * * @see _select() * * @param array $options The list of conditions for the query * * @return array The list of objects representing the table record */ public function all($options = null) { $profiles = parent::all($options); foreach ($profiles as $profile) { $new = !$profile->id ? true : false; // trigger save event $this->app->event->dispatcher->notify($this->app->event->create($profile, 'userprofile:init', compact('new'))); } return $profiles; }