mirror of
https://github.com/friendica/friendica
synced 2025-02-02 09:44:28 +00:00
Fix method parameter type in Model\Attach
This commit is contained in:
parent
78931afa6f
commit
28397fc5fc
1 changed files with 4 additions and 3 deletions
|
@ -11,6 +11,7 @@ use Friendica\Core\System;
|
||||||
use Friendica\Core\StorageManager;
|
use Friendica\Core\StorageManager;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Database\DBStructure;
|
use Friendica\Database\DBStructure;
|
||||||
|
use Friendica\Object\Image;
|
||||||
use Friendica\Util\Security;
|
use Friendica\Util\Security;
|
||||||
use Friendica\Util\DateTimeFormat;
|
use Friendica\Util\DateTimeFormat;
|
||||||
use Friendica\Util\Mimetype;
|
use Friendica\Util\Mimetype;
|
||||||
|
@ -257,9 +258,9 @@ class Attach extends BaseObject
|
||||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||||
* @see \Friendica\Database\DBA::update
|
* @see \Friendica\Database\DBA::update
|
||||||
*/
|
*/
|
||||||
public static function update($fields, $conditions, $img = null, array $old_fields = [])
|
public static function update($fields, $conditions, Image $img = null, array $old_fields = [])
|
||||||
{
|
{
|
||||||
if (!is_null($data)) {
|
if (!is_null($img)) {
|
||||||
// get items to update
|
// get items to update
|
||||||
$items = self::select(['backend-class','backend-ref'], $conditions);
|
$items = self::select(['backend-class','backend-ref'], $conditions);
|
||||||
|
|
||||||
|
@ -268,7 +269,7 @@ class Attach extends BaseObject
|
||||||
if ($backend_class !== '') {
|
if ($backend_class !== '') {
|
||||||
$fields['backend-ref'] = $backend_class::put($img->asString(), $item['backend-ref']);
|
$fields['backend-ref'] = $backend_class::put($img->asString(), $item['backend-ref']);
|
||||||
} else {
|
} else {
|
||||||
$fields['data'] = $data;
|
$fields['data'] = $img->asString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue