TraitsInterface
interface TraitsInterface
Represents models that can have traits
Methods
string[]
getTraits()
Returns a collection of traits
$this
$this
setTraits(array $traits)
Sets a collection of traits
Details
at line line 20
$this
addTrait(PhpTrait|string $trait)
Adds a trait.
If the trait is passed as PhpTrait object, the trait is also added as use statement.
at line line 27
string[]
getTraits()
Returns a collection of traits
at line line 35
bool
hasTrait(PhpTrait|string $trait)
Checks whether a trait exists
at line line 46
$this
removeTrait(PhpTrait|string $trait)
Removes a trait.
If the trait is passed as PhpTrait object, the trait is also removed from use statements.
at line line 54
$this
setTraits(array $traits)
Sets a collection of traits