Skip to content
Snippets Groups Projects
Commit b20a736c authored by Genvictus's avatar Genvictus
Browse files

feat: post manager filtering by tags

parent 6505ad99
Branches
Tags
No related merge requests found
......@@ -21,6 +21,11 @@ abstract class BaseManager
return self::$instance;
}
public static function arrToSQLArr($array)
{
return "{" . implode(",", $array) . "}";
}
public function getPDO()
{
return $this->pdo;
......
......@@ -27,7 +27,8 @@ class PostManager extends BaseManager
}
public function getByTags($tags = []) {
$where = ['tags' => ["@>", $tags, PDO::PARAM_STR]];
$arrTags = BaseManager::arrToSQLArr($tags);
$where = ['tags' => ["@>", $arrTags, PDO::PARAM_STR]];
}
public function getReplies($post_id, $owner_id)
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment