+ /**
+ * Delete media by uri-id and media type
+ *
+ * @param int $uri_id URI id
+ * @param array $types Media types
+ * @return bool Whether media attachment exists
+ * @throws \Exception
+ */
+ public static function deleteByURIId(int $uri_id, array $types = []): bool
+ {
+ $condition = ['uri-id' => $uri_id];
+
+ if (!empty($types)) {
+ $condition = DBA::mergeConditions($condition, ['type' => $types]);
+ }
+
+ return DBA::delete('post-media', $condition);
+ }
+