function create($name, $owner_guid = 0)
{
$name = trim($name);
if (empty($name)) {
return false;
}
if ($owner_guid == 0) {
$owner_guid = $this->session->getLoggedInUserGuid();
}
$db = $this->db;
$prefix = $db->prefix;
$name = $db->sanitizeString($name);
$q = "INSERT INTO {$prefix}access_collections\n\t\t\tSET name = '{$name}',\n\t\t\t\towner_guid = {$owner_guid}";
$id = $db->insertData($q);
if (!$id) {
return false;
}
$params = array('collection_id' => $id);
if (!$this->hooks->trigger('access:collections:addcollection', 'collection', $params, true)) {
return false;
}
return $id;
}