You are here

public function StockLocation::setActive in Commerce Stock 8

Sets the published status of a stock location.

Parameters

bool $active: TRUE to set this stock location to active, FALSE to set it to inactive.

Return value

\Drupal\commerce_stock_local\Entity\LocalStockLocationInterface The called stock location entity.

Overrides LocalStockLocationInterface::setActive

File

modules/local_storage/src/Entity/StockLocation.php, line 108

Class

StockLocation
Defines the stock location entity.

Namespace

Drupal\commerce_stock_local\Entity

Code

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