liquid_feedback_frontend

annotate model/agent.lua @ 1641:ab837b075cf7

Fixed mldap_get_named_number_arg to not leave any element on the Lua stack (should not have had any effect anyway but is now consistent to documentation)
author jbe
date Tue Feb 09 17:44:47 2021 +0100 (2021-02-09)
parents 32cc544d5a5b
children
rev   line source
bsw/jbe@1309 1 Agent= mondelefant.new_class()
bsw/jbe@1309 2 Agent.table = 'agent'
bsw/jbe@1309 3 Agent.primary_key = { "controlled_id", "controller_id" }
bsw/jbe@1309 4
bsw/jbe@1309 5 Agent:add_reference{
bsw/jbe@1309 6 mode = 'm1',
bsw/jbe@1309 7 to = "Member",
bsw/jbe@1309 8 this_key = 'controller_id',
bsw/jbe@1309 9 that_key = 'id',
bsw/jbe@1309 10 ref = 'controller',
bsw/jbe@1309 11 }
bsw/jbe@1309 12
bsw/jbe@1309 13 Agent:add_reference{
bsw/jbe@1309 14 mode = 'm1',
bsw/jbe@1309 15 to = "Member",
bsw/jbe@1309 16 this_key = 'controlled_id',
bsw/jbe@1309 17 that_key = 'id',
bsw/jbe@1309 18 ref = 'controllee',
bsw/jbe@1309 19 }
bsw/jbe@1309 20
bsw/jbe@1309 21 function Agent:by_pk(controlled_id, controller_id)
bsw/jbe@1309 22 return self:new_selector()
bsw/jbe@1309 23 :add_where{ "controlled_id = ?", controlled_id }
bsw/jbe@1309 24 :add_where{ "controller_id = ?", controller_id }
bsw/jbe@1309 25 :optional_object_mode()
bsw/jbe@1309 26 :exec()
bsw/jbe@1309 27 end

Impressum / About Us