Got database inserts for photos working.

This commit is contained in:
Ian Denhardt 2010-08-06 10:26:28 -04:00
parent 43454eba36
commit dd17e32c85
2 changed files with 11 additions and 0 deletions

View File

@ -129,6 +129,8 @@ class PhotouploadAction extends Action
$photo = new GNUsocialPhoto();
$photo->path = '/file/' . $filename;
$photo->thumb_path = '/file/thumb.' . $filename;
$photo->owner_id = $cur->id;
$photo->object_id = 'DEFAULT';
$photo->insert();
}

View File

@ -34,6 +34,7 @@ require_once INSTALLDIR . '/classes/Memcached_DataObject.php';
class GNUsocialPhoto extends Memcached_DataObject
{
public $__table = 'GNUsocialPhoto';
public $object_id; // integer
public $path; // varchar(150)
public $thumb_path; // varchar(156)
@ -54,4 +55,12 @@ class GNUsocialPhoto extends Memcached_DataObject
}
return parent::delete();
}
function table()
{
return array('object_id' => DB_DATAOBJECT_INT,
'path' => DB_DATAOBJECT_STR + DB_DATAOBJECT_NOTNULL,
'thumb_path' => DB_DATAOBJECT_STR + DB_DATAOBJECT_NOTNULL,
'owner_id' => DB_DATAOBJECT_INT + DB_DATAOBJECT_NOTNULL);
}
}