CommerceBundleEntityBase.php in Commerce Core 8.2
File
src/Entity/CommerceBundleEntityBase.php
View source
<?php
namespace Drupal\commerce\Entity;
use Drupal\Core\Config\Entity\ConfigEntityBundleBase;
class CommerceBundleEntityBase extends ConfigEntityBundleBase implements CommerceBundleEntityInterface {
protected $id;
protected $label;
protected $traits = [];
protected $locked = FALSE;
public function getTraits() {
return $this->traits;
}
public function setTraits(array $traits) {
$this->traits = $traits;
return $this;
}
public function hasTrait($trait) {
return in_array($trait, $this->traits);
}
public function isLocked() {
return (bool) $this->locked;
}
public function lock() {
$this->locked = TRUE;
return $this;
}
public function unlock() {
$this->locked = FALSE;
return $this;
}
}