<?php

namespace NPS\Entity;

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

/**
 * Abstract user query entity
 * @author Lukas Korinek
 * @ORM\InheritanceType("SINGLE_TABLE")
 * @ORM\DiscriminatorColumn(name="type", type="string")
 * @ORM\DiscriminatorMap({"question" = "UserQuestionQueryEntity", "error_reporting" = "ErrorReportingQueryEntity"})
 * @ORM\Entity
 * @ORM\Table(name="`user_query`")
 */
abstract class AbstractUserQueryEntity implements IEntity
{
    use TIdProperty;

    /**
     * @ORM\Column(type="datetime", name="date_created", length=250, nullable=false)
     * @var DateTime
     */
    public $dateCreated;

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

    public function __construct()
    {
        $this->dateCreated = new \DateTime();
    }
}

