I am trying to emulate the same behavior as when you use the admin panel to disable a product. I am trying to do something like this:
$product = $this->productRepository->get($sku);
$product->setStatus(\Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_DISABLED);
$this->productRepository->save($product);
But I still see it as enabled in the admin panel.
Thanks.