protected function replaceTraits($entityMetadata, &$stub)
    {
        $traits = [];

        // versionable
        if (! empty($entityMetadata['versionTable'])) {
            $traits['versionable'] = 'use \ProAI\Versioning\Versionable;';
        }

        // softDeletes
        if ($entityMetadata['softDeletes']) {
            $traits['softDeletes'] = 'use \ProAI\Versioning\SoftDeletes;';
        }

        // autoUuid
        if ($this->hasAutoUuidColumn($entityMetadata)) {
            $traits['autoUuid'] = 'use \ProAI\Datamapper\Eloquent\AutoUuid;';
        }

        $separator = PHP_EOL . PHP_EOL . '    ';
        $stub = str_replace('{{traits}}', implode($separator, $traits) . $separator, $stub);
    }
protected function replaceTraits($entityMetadata, &$stub)
    {
        $traits = [];

        // versionable
        if (! empty($entityMetadata['versionTable'])) {
            $traits['versionable'] = 'use \ProAI\Versioning\Versionable;';
        }

        // softDeletes
        if ($entityMetadata['softDeletes']) {
            $traits['softDeletes'] = 'use \ProAI\Versioning\SoftDeletes;';
        }

        // autoUuid
        if ($this->hasAutoUuidColumn($entityMetadata)) {
            $traits['autoUuid'] = 'use \ProAI\Datamapper\Eloquent\AutoUuid;';
        }

        $separator = PHP_EOL . PHP_EOL . '    ';
        $stub = str_replace('{{traits}}', implode($separator, $traits) . $separator, $stub);
    }
protected function replaceTraits ( $ entityMetadata , & $ stub ) { $ traits = [ ] ; // versionable if ( ! empty ( $ entityMetadata [ 'versionTable' ] ) ) { $ traits [ 'versionable' ] = 'use \ProAI\Versioning\Versionable;' ; } // softDeletes if ( $ entityMetadata [ 'softDeletes' ] ) { $ traits [ 'softDeletes' ] = 'use \ProAI\Versioning\SoftDeletes;' ; } // autoUuid if ( $ this -> hasAutoUuidColumn ( $ entityMetadata ) ) { $ traits [ 'autoUuid' ] = 'use \ProAI\Datamapper\Eloquent\AutoUuid;' ; } $ separator = PHP_EOL . PHP_EOL . '    ' ; $ stub = str_replace ( '{{traits}}' , implode ( $ separator , $ traits ) . $ separator , $ stub ) ; }
Replace traits.

@param \ProAI\Datamapper\Metadata\Definitions\Entity $entityMetadata
@param string $stub
@return void
Replace traits .