public function updateCategoryWithFB()

in Model/Feed/CategoryCollection.php [383:404]


    public function updateCategoryWithFB(Category $category, string $set_id)
    {
        $access_token = $this->fbeHelper->getAccessToken();
        if ($access_token == null) {
            $this->fbeHelper->log("can't find access token, won't update category with fb ");
        }
        $response = null;
        try {
            $url = $this->getCategoryUpdateApi($set_id);
            $params = [
                'access_token' => $access_token,
                'name' => $this->getCategoryPathName($category),
                'filter' => $this->getCategoryProductFilter($category),
            ];
            $this->curl->post($url, $params);
            $response = $this->curl->getBody();
            $this->fbeHelper->log("update category api response from fb:". $response);
        } catch (\Exception $e) {
            $this->fbeHelper->logException($e);
        }
        return $response;
    }