<?php

namespace App\Entity;

use Carbon\Carbon;
use DateTime;
use Doctrine\ORM\Mapping as ORM;

/**
 * Do not check entities with PHPMD.
 *
 * @SuppressWarnings("PHPMD")
 */
#[ORM\Table(name: 'broadcast')]
#[ORM\Entity(repositoryClass: \App\Repository\NewsletterRepository::class)]
class Newsletter
{
    public const REGULAR_NEWSLETTER = 'Normal';
    public const SPECIFIC_NEWSLETTER = 'Specific';
    public const TERMS_OF_USE = 'TermsOfUse';
    public const SUSPENSION_NOTIFICATION = 'SuspendAfter5Reminders';
    /**
     * @var Member
     */
    #[ORM\JoinColumn(name: 'IdCreator', referencedColumnName: 'id')]
    #[ORM\ManyToOne(targetEntity: \Member::class)]
    private $createdBy;

    /**
     * @var string
     */
    #[ORM\Column(name: 'Name', type: 'text', length: 65535, nullable: false)]
    private $name;

    /**
     * @var DateTime
     */
    #[ORM\Column(name: 'created', type: 'datetime', nullable: false)]
    private $created;

    /**
     * @var string
     */
    #[ORM\Column(name: 'Status', type: 'string', nullable: false)]
    private $status = 'Created';

    /**
     * @var string
     */
    #[ORM\Column(name: 'Type', type: 'string', nullable: true)]
    private $type;

    /**
     * @var string
     */
    #[ORM\Column(name: 'EmailFrom', type: 'text', length: 65535, nullable: true)]
    private $emailFrom;

    /**
     * @var int
     */
    #[ORM\Column(name: 'id', type: 'integer')]
    #[ORM\Id]
    #[ORM\GeneratedValue(strategy: 'IDENTITY')]
    private $id;

    /**
     * Set createdBy.
     *
     * @param Member $createdBy
     *
     * @return Newsletter
     */
    public function setCreatedBy($createdBy)
    {
        $this->createdBy = $createdBy;

        return $this;
    }

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

    /**
     * Set name.
     *
     * @param string $name
     *
     * @return Newsletter
     */
    public function setName($name)
    {
        $this->name = $name;

        return $this;
    }

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

    /**
     * Set created.
     *
     * @param DateTime $created
     *
     * @return Newsletter
     */
    public function setCreated($created)
    {
        $this->created = $created;

        return $this;
    }

    /**
     * Get created.
     *
     * @return Carbon
     */
    public function getCreated()
    {
        return Carbon::instance($this->created);
    }

    /**
     * Set status.
     *
     * @param string $status
     *
     * @return Newsletter
     */
    public function setStatus($status)
    {
        $this->status = $status;

        return $this;
    }

    /**
     * Get status.
     *
     * @return string
     */
    public function getStatus()
    {
        return $this->status;
    }

    /**
     * Set type.
     *
     * @param string $type
     *
     * @return Newsletter
     */
    public function setType($type)
    {
        $this->type = $type;

        return $this;
    }

    /**
     * Get type.
     *
     * @return string
     */
    public function getType()
    {
        return $this->type;
    }

    /**
     * Set emailFrom.
     *
     * @param string $emailFrom
     *
     * @return Newsletter
     */
    public function setEmailFrom($emailFrom)
    {
        $this->emailFrom = $emailFrom;

        return $this;
    }

    /**
     * Get emailFrom.
     *
     * @return string
     */
    public function getEmailFrom()
    {
        return $this->emailFrom;
    }

    /**
     * Get id.
     *
     * @return int
     */
    public function getId()
    {
        return $this->id;
    }
}
