mirror of
https://github.com/friendica/friendica
synced 2025-04-26 22:30:18 +00:00
The "[attach]" field is replaced by the "post-media" table
This commit is contained in:
parent
6d9e170502
commit
d383f49f1e
7 changed files with 58 additions and 104 deletions
|
@ -263,11 +263,18 @@ class Media
|
|||
* Retrieves the media attachments associated with the provided item ID.
|
||||
*
|
||||
* @param int $uri_id
|
||||
* @param array $types
|
||||
* @return array
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function getByURIId(int $uri_id)
|
||||
public static function getByURIId(int $uri_id, array $types = [])
|
||||
{
|
||||
return DBA::selectToArray('post-media', [], ['uri-id' => $uri_id]);
|
||||
$condition = ['uri-id' => $uri_id];
|
||||
|
||||
if (!empty($types)) {
|
||||
$condition = DBA::mergeConditions($condition, ['type' => $types]);
|
||||
}
|
||||
|
||||
return DBA::selectToArray('post-media', [], $condition);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue