/** * @param $user_id * @return ListingNames */ public function getUserIgnoreList($user_id) { $list = ListingNames::model()->find('user_id=:user_id AND ignored=1', array(':user_id' => $user_id)); if (empty($list)) { $list = new ListingNames(); $list->date_create = time(); $list->date_update = time(); $list->ignored = 1; $list->user_id = $user_id; $list->name = 'ignore-list'; $list->save(); } return $list; }