Editing of media descriptions is now possible as well

This commit is contained in:
Michael 2023-02-28 08:06:49 +00:00
parent 98aed4dde3
commit 3a0b0ffce5
3 changed files with 88 additions and 31 deletions

View file

@ -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.
*