Revize 74a7dbca
Přidáno uživatelem Michal Kliment před více než 9 roky(ů)
application/models/aro_group.php | ||
---|---|---|
WHERE group_id = ?
|
||
", $group_id);
|
||
}
|
||
|
||
/**
|
||
* Cleans ARO - deletes all ARO groups
|
||
*
|
||
* @author David Raska
|
||
* @param integer $aro_id
|
||
*/
|
||
public function clean_aro ($aro_id)
|
||
{
|
||
if (!$aro_id)
|
||
return;
|
||
|
||
$this->db->query("
|
||
DELETE FROM groups_aro_map
|
||
WHERE aro_id = ?
|
||
", $aro_id);
|
||
}
|
||
|
||
/**
|
||
* Counts all childrens of given group
|
||
... | ... | |
$this->db->query($sql_insert);
|
||
}
|
||
}
|
||
|
||
|
||
/**
|
||
* Inserts given groups to given ARO
|
||
*
|
||
* @author David Raska
|
||
* @param array $groups
|
||
* @param integer $aro_id
|
||
*/
|
||
public function insert_groups($groups = array(), $aro_id)
|
||
{
|
||
if (!$aro_id)
|
||
return;
|
||
|
||
$aro_id = intval($aro_id);
|
||
|
||
$sql_insert = "INSERT INTO groups_aro_map (group_id, aro_id) VALUES ";
|
||
|
||
$values = array();
|
||
foreach ($groups as $group)
|
||
$values[] = "(".intval($group).", $aro_id)";
|
||
|
||
if (count($values))
|
||
{
|
||
$sql_insert .= implode(',', $values);
|
||
$this->db->query($sql_insert);
|
||
}
|
||
}
|
||
}
|
Také k dispozici: Unified diff
Merge from SVN branch 1.2.