/** * Add new ignore. * * @static * @param integer $user_id * @param integer $ignore_id * @return boolean */ public static function add($user_id, $ignore_id) { try { $ignore = new Model_Ignore(); $ignore->set_fields(array('user_id' => $user_id, 'ignore_id' => $ignore_id, 'created' => time())); $ignore->save(); Anqh::cache_delete('ignores_' . $user_id); Anqh::cache_delete('ignorers_' . $ignore_id); return true; } catch (Exception $e) { return false; } }
/** * Get user's ignores or users ignoring user * * @param boolean $ignorers true for ignorers, false for ignores * @return array */ public function find_ignores($ignorers = false) { return $ignorers ? Model_Ignore::find_by_ignorer($this->id) : Model_Ignore::find_by_user($this->id); }