public function getAllPhoneNumbersForFPN($userId, $phoneNumber, $country)
{
$query = \OCP\DB::prepare('SELECT sms_address FROM ' . '*PREFIX*ocsms_smsdatas WHERE user_id = ? AND sms_mailbox IN (?,?)');
$result = $query->execute(array($userId, 0, 1));
$phoneList = array();
while ($row = $result->fetchRow()) {
$pn = $row["sms_address"];
$fmtPN = PhoneNumberFormatter::format($country, $pn);
if (!isset($phoneList[$fmtPN])) {
$phoneList[$fmtPN] = array();
}
if (!isset($phoneList[$fmtPN][$pn])) {
$phoneList[$fmtPN][$pn] = 0;
}
$phoneList[$fmtPN][$pn] += 1;
}
$fpn = PhoneNumberFormatter::format($country, $phoneNumber);
if (isset($phoneList[$fpn])) {
return $phoneList[$fpn];
} else {
return array();
}
}