<?php


namespace CubiStore\Web\Model;

use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;

/**
 * @ORM\Entity
 * @ORM\Table(name="app")
 */
class App
{
    const STATUS_CREATED = 'created';
    const STATUS_REJECTED = 'rejected';
    const STATUS_APPROVED = 'approved';

    /**
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     * @ORM\Column(type="bigint")
     * @var integer
     */
    private $id;

    /**
     * @ORM\Column(type="string")
     * @var string
     */
    private $name;

    /**
     * @ORM\Column(type="string")
     * @var string
     */
    private $status = self::STATUS_CREATED;

    /**
     * @ORM\Column(type="string")
     * @var string
     */
    private $label;

    /**
     * @ORM\OneToMany(targetEntity="Release", mappedBy="app")
     * @var Release[]|ArrayCollection
     */
    private $releases;

    public function __construct()
    {
        $this->releases = new ArrayCollection();
    }

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

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

    /**
     * @param string $name
     */
    public function setName(string $name): void
    {
        $this->name = $name;
    }

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

    /**
     * @param string $label
     */
    public function setLabel(string $label): void
    {
        $this->label = $label;
    }

    /**
     * @return Release[]|ArrayCollection
     */
    public function getReleases()
    {
        return $this->releases;
    }

    /**
     * @param Release[]|ArrayCollection $releases
     */
    public function setReleases($releases): void
    {
        $this->releases = $releases;
    }

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

    /**
     * @param string $status
     */
    public function setStatus(string $status): void
    {
        $this->status = $status;
    }
}
