liquid_feedback_frontend

view model/member_application.lua @ 1800:b87997219042

Updated spanish translation
author bsw
date Thu Oct 21 15:22:29 2021 +0200 (2021-10-21)
parents 32cc544d5a5b
children
line source
1 MemberApplication = mondelefant.new_class()
2 MemberApplication.table = 'member_application'
4 MemberApplication:add_reference{
5 mode = 'm1',
6 to = "SystemApplication",
7 this_key = 'system_application_id',
8 that_key = 'id',
9 ref = 'system_application'
10 }
12 function MemberApplication:get_selector_by_member_id_and_system_application_id(member_id, system_application_id)
13 local selector = self:new_selector()
14 selector:add_where{ "member_id = ?", member_id }
15 selector:add_where{ "system_application_id = ?", system_application_id }
16 selector:optional_object_mode()
17 return selector
18 end
20 function MemberApplication:by_member_id_and_system_application_id(member_id, system_application_id)
21 local member_application = self:get_selector_by_member_id_and_system_application_id(member_id, system_application_id)
22 :optional_object_mode()
23 :exec()
24 return member_application
25 end
27 function MemberApplication:get_selector_by_member_id_and_domain(member_id, domain)
28 local selector = self:new_selector()
29 selector:add_where{ "member_id = ?", member_id }
30 selector:add_where{ "domain = ?", domain }
31 selector:optional_object_mode()
32 return selector
33 end
35 function MemberApplication:by_member_id_and_domain(member_id, domain)
36 local member_application = self:get_selector_by_member_id_and_domain(member_id, domain)
37 :optional_object_mode()
38 :exec()
39 return member_application
40 end
42 function MemberApplication:by_member_id(member_id)
43 local member_applications = self:new_selector()
44 :add_where{ "member_id = ?", member_id }
45 :exec()
46 return member_applications
47 end
49 function MemberApplication:by_member_id_with_domain(member_id)
50 local member_applications = self:new_selector()
51 :add_where{ "member_id = ?", member_id }
52 :add_where( "domain NOTNULL" )
53 :exec()
54 return member_applications
55 end
57 function MemberApplication:by_member_id_and_origin(member_id, origin)
58 local domain = string.match(string.lower(origin), "^https://(.+)")
59 if not domain then
60 return
61 end
62 local member_application = self:get_selector_by_member_id_and_domain(member_id, domain)
63 :optional_object_mode()
64 :exec()
65 return member_application
66 end

Impressum / About Us