You are here

public function ProductBundle::setPublished in Commerce Product Bundle 8

Sets the published status of a product bundle.

Parameters

bool $published: TRUE to set this product bundle to published, FALSE to set it to unpublished.

Return value

\Drupal\commerce_product_bundle\Entity\BundleInterface The called product bundle entity.

Overrides BundleInterface::setPublished

File

src/Entity/ProductBundle.php, line 156

Class

ProductBundle
Defines the product bundle entity.

Namespace

Drupal\commerce_product_bundle\Entity

Code

public function setPublished($published) {
  $this
    ->set('status', $published ? TRUE : FALSE);
  return $this;
}