liquid_feedback_frontend
view model/system_application.lua @ 1616:3f2f57fba114
Make event info icon smaller
author | bsw |
---|---|
date | Mon Feb 01 21:55:12 2021 +0100 (2021-02-01) |
parents | 32cc544d5a5b |
children |
line source
1 SystemApplication = mondelefant.new_class()
2 SystemApplication.table = 'system_application'
5 function SystemApplication:by_client_id(client_id)
6 local system_application = self:new_selector()
7 :add_where{ "client_id = ?", client_id }
8 :optional_object_mode()
9 :exec()
10 return system_application
11 end
13 function SystemApplication:by_origin(origin)
14 local system_applications = self:new_selector()
15 :set_distinct()
16 :left_join("system_application_redirect_uri", nil, "system_application_redirect_uri.system_application_id = system_application.id")
17 :add_where{ "lower(regexp_replace(system_application.default_redirect_uri, '^([^:]+://[^/]+)/.*', E'\\\\1', 'i')) = lower(?) OR lower(regexp_replace(system_application_redirect_uri.redirect_uri, '^([^:]+://[^/]+)/.*', E'\\\\1', 'i')) = lower(?)", origin, origin }
18 :exec()
19 return system_applications
20 end
22 function SystemApplication:get_all()
23 local system_application = self:new_selector()
24 :exec()
25 return system_application
26 end