mirror of
https://github.com/friendica/friendica
synced 2025-04-27 20:30:13 +00:00
Editing of media descriptions is now possible as well
This commit is contained in:
parent
98aed4dde3
commit
3a0b0ffce5
3 changed files with 88 additions and 31 deletions
|
@ -697,6 +697,30 @@ class Media
|
|||
return DBA::selectToArray('post-media', [], $condition, ['order' => ['id']]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the media attachment with the provided media id.
|
||||
*
|
||||
* @param int $id id
|
||||
* @return array|bool Array on success, false on error
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function getById(int $id)
|
||||
{
|
||||
return DBA::selectFirst('post-media', [], ['id' => $id]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update post-media entries
|
||||
*
|
||||
* @param array $fields
|
||||
* @param int $id
|
||||
* @return bool
|
||||
*/
|
||||
public static function updateById(array $fields, int $id): bool
|
||||
{
|
||||
return DBA::update('post-media', $fields, ['id' => $id]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if media attachments are associated with the provided item ID.
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue