<?php

namespace ServiceCore\Application\Command;

use ServiceCore\Infrastructure\Service\GuidGenerator;

/**
 * Class AbstractEntityCreateCommand
 *
 * @package ServiceCore\Application\Command
 */
abstract class AbstractEntityCreateCommand implements CommandInterface
{
    /**
     * @var string
     */
    protected $guid;

    /**
     * @var string
     */
    protected $name;
    
    /**
     * AbstractEntityCreateCommand constructor.
     *
     * @param string $guid
     * @param string $name
     *
     * @throws InvalidGuid
     */
    public function __construct(
        string $guid,
        string $name
    ) {
        (new GuidGenerator())->validate($guid);
        $this->guid = $guid;
        $this->name = $name;
    }

    /**
     * @return string
     */
    public function getGuid(): string
    {
        return $this->guid;
    }

    /**
     * @return string
     */
    public function getName(): string
    {
        return $this->name;
    }
}