diff options
author | Zach Copley <zach@controlyourself.ca> | 2009-05-15 23:17:57 +0000 |
---|---|---|
committer | Zach Copley <zach@controlyourself.ca> | 2009-05-15 23:17:57 +0000 |
commit | 811cef10083f8b7824b2fd8140f940bf13b54c8d (patch) | |
tree | 3d403c3c7e08a79a3a87c5bafacfb3f08fcd4211 /classes/File_thumbnail.php | |
parent | 3f44f94c3c3f0c3d46f5025854431f0d2825bb6c (diff) | |
parent | 6c4e26fe61a3c1cada4775a42a929eb884150b2d (diff) |
Merge branch '0.8.x' into fbconnect
Diffstat (limited to 'classes/File_thumbnail.php')
-rw-r--r-- | classes/File_thumbnail.php | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/classes/File_thumbnail.php b/classes/File_thumbnail.php new file mode 100644 index 000000000..1a65b92c9 --- /dev/null +++ b/classes/File_thumbnail.php @@ -0,0 +1,55 @@ +<?php +/* + * Laconica - a distributed open-source microblogging tool + * Copyright (C) 2008, Controlez-Vous, Inc. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +if (!defined('LACONICA')) { exit(1); } + +require_once INSTALLDIR.'/classes/Memcached_DataObject.php'; + +/** + * Table Definition for file_thumbnail + */ + +class File_thumbnail extends Memcached_DataObject +{ + ###START_AUTOCODE + /* the code below is auto generated do not remove the above tag */ + + public $__table = 'file_thumbnail'; // table name + public $id; // int(11) not_null primary_key group_by + public $file_id; // int(11) unique_key group_by + public $url; // varchar(255) unique_key + public $width; // int(11) group_by + public $height; // int(11) group_by + + /* Static get */ + function staticGet($k,$v=NULL) { return DB_DataObject::staticGet('File_thumbnail',$k,$v); } + + /* the code above is auto generated do not remove the tag below */ + ###END_AUTOCODE + + function saveNew($data, $file_id) { + $tn = new File_thumbnail; + $tn->file_id = $file_id; + $tn->url = $data['thumbnail_url']; + $tn->width = intval($data['thumbnail_width']); + $tn->height = intval($data['thumbnail_height']); + $tn->insert(); + } +} + |