public static function addPuserRole($kshow_id, $partner_id, $subp_id, $puser_id, $role) { $puser_id = trim($puser_id); if (empty($puser_id)) { return null; } // TODO - first check if already exist $kshow_id , $partner_id , $puser_id $puser_role = new PuserRole(); $puser_role->setKshowId($kshow_id); $puser_role->setPartnerId($partner_id); $puser_role->setSubpId($subp_id); $puser_role->setPuserId($puser_id); $puser_role->setRole($role); $puser_role->save(); return $puser_role->getId(); }