jeyroik/extas-base

View on GitHub
src/components/THasName.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php
namespace extas\components;

use extas\interfaces\IHasName;

/**
 * Trait THasName
 *
 * @property $config
 *
 * @package extas\components
 * @author jeyroik@gmail.com
 */
trait THasName
{
    /**
     * @return string
     */
    public function getName(): string
    {
        return $this->config[IHasName::FIELD__NAME] ?? '';
    }

    /**
     * @param string $name
     *
     * @return $this
     */
    public function setName(string $name)
    {
        $this->config[IHasName::FIELD__NAME] = $name;

        return $this;
    }
}