diff options
Diffstat (limited to 'plugins/GNUsocialPhotos/classes/gnusocialphotoalbum.php')
-rw-r--r-- | plugins/GNUsocialPhotos/classes/gnusocialphotoalbum.php | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/plugins/GNUsocialPhotos/classes/gnusocialphotoalbum.php b/plugins/GNUsocialPhotos/classes/gnusocialphotoalbum.php index 853854e42..13c7663a6 100644 --- a/plugins/GNUsocialPhotos/classes/gnusocialphotoalbum.php +++ b/plugins/GNUsocialPhotos/classes/gnusocialphotoalbum.php @@ -69,8 +69,8 @@ class GNUsocialPhotoAlbum extends Memcached_DataObject function sequenceKey() { - return array(false, false, false); - } + return array('album_id', true, false); + } static function newAlbum($profile_id, $album_name) { @@ -81,14 +81,16 @@ class GNUsocialPhotoAlbum extends Memcached_DataObject } $album = new GNUsocialPhotoAlbum(); - //TODO: Should autoincrement.. $album->profile_id = $profile_id; $album->album_name = $album_name; - - if ($album->insert() == false){ + + $album->album_id = $album->insert(); + if (!$album->album_id){ common_log_db_error($album, 'INSERT', __FILE__); throw new ServerException(_m('Error creating new album.')); } + common_log(LOG_INFO, 'album_id : ' . $album->album_id); + return $album; } } |