. * */ namespace Friendica\Model\Post; use Friendica\Database\DBA; use \BadMethodCallException; use Friendica\Database\Database; class Collection { const FEATURED = 0; /** * Add a post to a collection * * @param integer $uri_id * @param integer $type */ public static function add(int $uri_id, int $type) { if (empty($uri_id)) { throw new BadMethodCallException('Empty URI_id'); } DBA::insert('post-collection', ['uri-id' => $uri_id, 'type' => $type], Database::INSERT_IGNORE); } /** * Remove a post from a collection * * @param integer $uri_id * @param integer $type */ public static function remove(int $uri_id, int $type) { if (empty($uri_id)) { throw new BadMethodCallException('Empty URI_id'); } DBA::delete('post-collection', ['uri-id' => $uri_id, 'type' => $type]); } }