public function CommerceBundleEntityBase::hasTrait in Commerce Core 8.2
Gets whether the bundle has the given trait.
Parameters
string $trait: The trait plugin ID.
Overrides CommerceBundleEntityInterface::hasTrait
File
- src/
Entity/ CommerceBundleEntityBase.php, line 58
Class
- CommerceBundleEntityBase
- Provides the base class for Commerce bundle entities.
Namespace
Drupal\commerce\EntityCode
public function hasTrait($trait) {
return in_array($trait, $this->traits);
}