gossi\codegen\model\parts\TraitsPart::hasTrait PHP Method

hasTrait() public method

Checks whether a trait exists
public hasTrait ( PhpTrait | string $trait ) : boolean
$trait gossi\codegen\model\PhpTrait | string
return boolean `true` if it exists and `false` if not
    public function hasTrait($trait)
    {
        if (!$trait instanceof PhpTrait) {
            $trait = new PhpTrait($trait);
        }
        $name = $trait->getName();
        return in_array($name, $this->traits);
    }