Commit 43a3f5ea authored by mmn's avatar mmn

File_oembed::saveNew are File::saveNew are static

Also did some non-backwards-compatible (to StatusNet) code cleanup.
parent 72707ddc
......@@ -74,7 +74,7 @@ class File extends Managed_DataObject
* @param string $given_url
* @return File
*/
function saveNew(array $redir_data, $given_url) {
public static function saveNew(array $redir_data, $given_url) {
// I don't know why we have to keep doing this but I'm adding this last check to avoid
// uniqueness bugs.
......
......@@ -17,10 +17,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); }
require_once INSTALLDIR.'/classes/Memcached_DataObject.php';
require_once INSTALLDIR.'/classes/File_redirection.php';
if (!defined('GNUSOCIAL')) { exit(1); }
/**
* Table Definition for file_oembed
......@@ -28,9 +25,6 @@ require_once INSTALLDIR.'/classes/File_redirection.php';
class File_oembed extends Managed_DataObject
{
###START_AUTOCODE
/* the code below is auto generated do not remove the above tag */
public $__table = 'file_oembed'; // table name
public $file_id; // int(4) primary_key not_null
public $version; // varchar(20)
......@@ -47,9 +41,6 @@ class File_oembed extends Managed_DataObject
public $url; // varchar(255)
public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP
/* the code above is auto generated do not remove the tag below */
###END_AUTOCODE
public static function schemaDef()
{
return array(
......@@ -100,7 +91,7 @@ class File_oembed extends Managed_DataObject
* @param object $data Services_oEmbed_Object_*
* @param int $file_id
*/
function saveNew($data, $file_id) {
public static function saveNew($data, $file_id) {
$file_oembed = new File_oembed;
$file_oembed->file_id = $file_id;
if (!isset($data->version)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment