public function __construct() { parent::__construct(); $watcher = Model_WatchPhotographer::getCurrentWatch(); if (!empty($watcher)) { $photo = $watcher->user->photos->where("moderation_status_id", "=", Model_ModerationStatus::APPROVED)->order_by(DB::expr('RAND()'))->find(); $this->template->watcher = $watcher; $this->template->photo = $photo; $this->template->numPhotos = $watcher->user->photos->where("moderation_status_id", "=", Model_ModerationStatus::APPROVED)->find_all()->count(); } }
public function action_archive() { $this->template->content = View::factory("admin/watcher/index"); $this->template->content->watchers = Model_WatchPhotographer::getPastWatchers(); }