addSelect('ID') ->where('EMAIL', $email) ->exec() ->fetchObject(); if ($user instanceof EntityObject) { $userId = $user->get('ID'); if (is_int($userId) && $userId > 0) { return $userId; } } return null; } }