<?php

namespace AppBundle\Entity\Traits;

use Doctrine\ORM\Mapping as ORM;
use Dunglas\ApiBundle\Annotation\Iri;
use Symfony\Component\Serializer\Annotation\Groups;
use Symfony\Component\Validator\Constraints as Assert;

/**
 * @Iri("http://schema.org/Generic")
 */
trait CreatorUpdaterEntity
{
    /**
     * @var int
     */
    #[ORM\Column(type: 'integer', nullable: true)]
    #[Assert\Type(type: 'integer', message: 'invalid-integer')]
    #[Groups(['organizationresponsability', 'person', 'networkorganization', 'organizationfunction', 'educationnotation'])]
    private $legacyId;

    /**
     * @var int
     */
    #[ORM\Column(type: 'integer', nullable: true)]
    #[Assert\Type(type: 'integer', message: 'invalid-integer')]
    private $createdBy;
    /**
     * @var int
     */
    #[ORM\Column(type: 'integer', nullable: true)]
    #[Assert\Type(type: 'integer', message: 'invalid-integer')]
    private $updatedBy;
    /**
     * @var bool
     */
    #[ORM\Column(type: 'boolean', options: ['default' => false])]
    #[Assert\Type(type: 'boolean')]
    #[Assert\NotNull]
    private $draft = false;

    /**
     * Sets legacyId.
     *
     * @param int $legacyId
     *
     * @return $this
     */
    public function setLegacyId($legacyId)
    {
        $this->legacyId = $legacyId;

        return $this;
    }

    /**
     * Gets legacyId.
     *
     * @return int
     */
    public function getLegacyId()
    {
        return $this->legacyId;
    }

    /**
     * Sets createdBy.
     *
     * @param int $createdBy
     *
     * @return $this
     */
    public function setCreatedBy($createdBy)
    {
        $this->createdBy = $createdBy;

        return $this;
    }

    /**
     * Gets createdBy.
     *
     * @return int
     */
    public function getCreatedBy()
    {
        return $this->createdBy;
    }

    /**
     * Sets updatedBy.
     *
     * @param int $updatedBy
     *
     * @return $this
     */
    public function setUpdatedBy($updatedBy)
    {
        $this->updatedBy = $updatedBy;

        return $this;
    }

    /**
     * Gets updatedBy.
     *
     * @return int
     */
    public function getUpdatedBy()
    {
        return $this->updatedBy;
    }

    /**
     * Sets draft.
     *
     * @param bool $draft
     *
     * @return $this
     */
    public function setDraft($draft)
    {
        $this->draft = $draft;

        return $this;
    }

    /**
     * Gets draft.
     *
     * @return bool
     */
    public function getDraft()
    {
        return $this->draft;
    }

    /**
     * NEED THIS FOR ELASTICA TRANSLATABLE
     * @return null
     */
    public function getTranslatable(){
        return null;
    }

    /**
     * NEED THIS FOR ELASTICA TRANSLATABLE
     * @return null
     */
    public function getPhoneNumberType(){
        return null;
    }
}