OCA\OcSms\Db\SmsMapper::getAllIds PHP Method

getAllIds() public method

public getAllIds ( $userId )
    public function getAllIds($userId)
    {
        $query = \OCP\DB::prepare('SELECT sms_id, sms_mailbox FROM ' . '*PREFIX*ocsms_smsdatas WHERE user_id = ?');
        $result = $query->execute(array($userId));
        $smsList = array();
        while ($row = $result->fetchRow()) {
            // This case may not arrive, but we test if the DB is consistent
            if (!in_array($row["sms_mailbox"], SmsMapper::$mailboxNames)) {
                continue;
            }
            $mbox = SmsMapper::$mailboxNames[$row["sms_mailbox"]];
            if (!isset($smsList[$mbox])) {
                $smsList[$mbox] = array();
            }
            if (!in_array($row["sms_id"], $smsList[$mbox])) {
                array_push($smsList[$mbox], $row["sms_id"]);
            }
        }
        return $smsList;
    }