File_oembed::saveNew are File::saveNew are static
Also did some non-backwards-compatible (to StatusNet) code cleanup.
This commit is contained in:
parent
72707ddc26
commit
43a3f5ea90
|
@ -74,7 +74,7 @@ class File extends Managed_DataObject
|
||||||
* @param string $given_url
|
* @param string $given_url
|
||||||
* @return File
|
* @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
|
// I don't know why we have to keep doing this but I'm adding this last check to avoid
|
||||||
// uniqueness bugs.
|
// uniqueness bugs.
|
||||||
|
|
|
@ -17,10 +17,7 @@
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); }
|
if (!defined('GNUSOCIAL')) { exit(1); }
|
||||||
|
|
||||||
require_once INSTALLDIR.'/classes/Memcached_DataObject.php';
|
|
||||||
require_once INSTALLDIR.'/classes/File_redirection.php';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Table Definition for file_oembed
|
* Table Definition for file_oembed
|
||||||
|
@ -28,9 +25,6 @@ require_once INSTALLDIR.'/classes/File_redirection.php';
|
||||||
|
|
||||||
class File_oembed extends Managed_DataObject
|
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 $__table = 'file_oembed'; // table name
|
||||||
public $file_id; // int(4) primary_key not_null
|
public $file_id; // int(4) primary_key not_null
|
||||||
public $version; // varchar(20)
|
public $version; // varchar(20)
|
||||||
|
@ -47,9 +41,6 @@ class File_oembed extends Managed_DataObject
|
||||||
public $url; // varchar(255)
|
public $url; // varchar(255)
|
||||||
public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP
|
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()
|
public static function schemaDef()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
|
@ -100,7 +91,7 @@ class File_oembed extends Managed_DataObject
|
||||||
* @param object $data Services_oEmbed_Object_*
|
* @param object $data Services_oEmbed_Object_*
|
||||||
* @param int $file_id
|
* @param int $file_id
|
||||||
*/
|
*/
|
||||||
function saveNew($data, $file_id) {
|
public static function saveNew($data, $file_id) {
|
||||||
$file_oembed = new File_oembed;
|
$file_oembed = new File_oembed;
|
||||||
$file_oembed->file_id = $file_id;
|
$file_oembed->file_id = $file_id;
|
||||||
if (!isset($data->version)) {
|
if (!isset($data->version)) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user