<?php

namespace App\Model\Entities\Components;

use App\Model\Entities\Security\User;
use Doctrine\ORM\Mapping as ORM;


/**
 * @ORM\Entity
 */
abstract class TextEntryTranslation extends TextEntryData
{
    /**
     * @var TextEntryVersion
     * @ORM\ManyToOne(targetEntity="TextEntryVersion")
     */
    protected $version;

    /**
     * TextEntryTranslation constructor.
     * @param User $createdBy
     * @param TextEntryVersion $version
     * @param $language
     */
    public function __construct(User $createdBy, TextEntryVersion $version, $language)
    {
        parent::__construct($createdBy, $language);

        $this->textEntry = $version->textEntry;
        $this->version = $version;
    }

    /**
     * @return TextEntryVersion
     */
    public function getVersion()
    {
        return $this->version;
    }

}