public static function getPrimaryImageForUsers($userIds) { $criteria = new CDbCriteria(); $criteria->addInCondition('user_id', $userIds); $models = UserPhotos::model()->findAll($criteria); $result = false; foreach ($models as $model) { $result[$model->user_id] = ImageUtils::getImageUrl('profiles', $model->user_id, $model->image); } return $result; }
/** * Returns a collection of photos belonging to the user. * @return UserPhotos */ public function getPhotos() { return UserPhotos::get($this->getID()); }