Rev 1130 | Rev 1143 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1130 | Rev 1140 | ||
---|---|---|---|
Line 45... | Line 45... | ||
45 | * @return bool|null |
45 | * @return bool|null |
46 | * @throws OIDplusException |
46 | * @throws OIDplusException |
47 | */ |
47 | */ |
48 | public static function alreadyHasFreeOid(string $email, bool $getId = false)/*: ?bool*/ { |
48 | public static function alreadyHasFreeOid(string $email, bool $getId = false)/*: ?bool*/ { |
49 | $res = OIDplus::db()->query("select id from ###objects where ra_email = ? and id like ? order by ".OIDplus::db()->natOrder('id'), array($email, self::getFreeRootOid(true).'.%')); |
49 | $res = OIDplus::db()->query("select id from ###objects where ra_email = ? and id like ? order by ".OIDplus::db()->natOrder('id'), array($email, self::getFreeRootOid(true).'.%')); |
50 | while ($row = $res->fetch_array()) { |
50 | if ($row = $res->fetch_array()) { |
51 | return $getId ? $row['id'] : true; |
51 | return $getId ? $row['id'] : true; |
52 | } |
52 | } |
53 | return $getId ? null : false; |
53 | return $getId ? null : false; |
54 | } |
54 | } |
55 | 55 |