aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/objects.php
diff options
context:
space:
mode:
authorben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-07-18 18:23:50 +0000
committerben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-07-18 18:23:50 +0000
commit361bff59658e6119b76e7ff31cd67c6054c93c8f (patch)
tree115c0eb308aa1312f7e69b52506eb625a2887c0d /engine/lib/objects.php
parent0c997a2fe195542c1cdec5b828cea87d0992dc78 (diff)
downloadelgg-361bff59658e6119b76e7ff31cd67c6054c93c8f.tar.gz
elgg-361bff59658e6119b76e7ff31cd67c6054c93c8f.tar.bz2
Moved container_guid to entities, modified a bunch of functions.
git-svn-id: https://code.elgg.org/elgg/trunk@1473 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib/objects.php')
-rw-r--r--engine/lib/objects.php11
1 files changed, 4 insertions, 7 deletions
diff --git a/engine/lib/objects.php b/engine/lib/objects.php
index 2067fe5c2..d2f90bdfd 100644
--- a/engine/lib/objects.php
+++ b/engine/lib/objects.php
@@ -259,18 +259,15 @@
*
* @param int $guid The guid of the entity you're creating (as obtained by create_entity)
* @param string $title The title of the object
- * @param string $description The object's description
- * @param int $container_guid The object's container guid (defaults to the current logged in user)
+ * @param string $description The object's description
*/
- function create_object_entity($guid, $title, $description, $container_guid = 0)
+ function create_object_entity($guid, $title, $description)
{
global $CONFIG;
$guid = (int)$guid;
$title = sanitise_string($title);
$description = sanitise_string($description);
- $container_guid = (int)$container_guid;
- if (!$container_guid) $container_guid = $_SESSION['guid'];
$row = get_entity_as_row($guid);
@@ -278,7 +275,7 @@
{
// Core entities row exists and we have access to it
if ($exists = get_data_row("select guid from {$CONFIG->dbprefix}objects_entity where guid = {$guid}")) {
- $result = update_data("UPDATE {$CONFIG->dbprefix}objects_entity set title='$title', description='$description', container_guid=$container_guid where guid=$guid");
+ $result = update_data("UPDATE {$CONFIG->dbprefix}objects_entity set title='$title', description='$description' where guid=$guid");
if ($result!=false)
{
// Update succeeded, continue
@@ -294,7 +291,7 @@
{
// Update failed, attempt an insert.
- $result = insert_data("INSERT into {$CONFIG->dbprefix}objects_entity (guid, container_guid, title, description) values ($guid, $container_guid, '$title','$description')");
+ $result = insert_data("INSERT into {$CONFIG->dbprefix}objects_entity (guid, title, description) values ($guid, '$title','$description')");
if ($result!==false) {
$entity = get_entity($guid);
if (trigger_elgg_event('create',$entity->type,$entity)) {