41 $this->db = $DIC->database();
57 $this->obj_id = $a_obj_id;
97 $this->profiles = array();
107 $this->profiles[$a_profile_id] = array(
108 "profile_id" => $a_profile_id
119 unset($this->profiles[$a_profile_id]);
139 $this->profiles = array();
141 "SELECT spr.profile_id, spr.role_id, sp.title FROM skl_profile_role spr INNER JOIN skl_profile sp " .
142 " ON spr.profile_id = sp.id " .
143 " WHERE sp.ref_id = 0 " .
144 " AND role_id = " .
$db->quote($this->getMemberRoleId(),
"integer")
146 while ($rec =
$db->fetchAssoc($set)) {
147 $this->profiles[$rec[
"profile_id"]] = $rec;
154 protected function delete()
159 "DELETE spr FROM skl_profile_role spr INNER JOIN skl_profile sp " .
160 " ON spr.profile_id = sp.id " .
161 " WHERE sp.ref_id = 0 " .
162 " AND role_id = " .
$db->quote($this->getMemberRoleId(),
"integer")
174 foreach ($this->profiles as $p) {
175 $db->manipulate(
"INSERT INTO skl_profile_role " .
176 "(role_id, profile_id) VALUES (" .
177 $db->quote($this->getMemberRoleId(),
"integer") .
"," .
178 $db->quote($p[
"profile_id"],
"integer") .
")");
addProfile(int $a_profile_id)
Add profile.
static getDefaultMemberRole($a_ref_id)
resetProfiles()
Reset profiles.
getMemberRoleId()
Get member role id of object.
static _getAllReferences($a_id)
get all reference ids of object
removeProfile(int $a_profile_id)
Remove profile.
Global competence profiles of a container.
__construct(int $a_obj_id)
Constructor.
getProfiles()
Get profiles.
setMemberRoleId()
Set member role id of object.
setObjId(int $a_obj_id)
Set object id.