public function listAvalible() { global $db; $sql = "SELECT count(*) FROM " . self::RELATION_TABLE . " WHERE medlem_id = " . $this->getMedlemId(); $count = $db->value($sql); if ($count == 0) { return Mal::listAll(); } else { return Mal::listByIds(array_keys($this->listMal()), true); } }