Completed
Push — master ( 5d51b4...87fdd9 )
by Paul
10s
created

ViewTranslationLegacy::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
rs 9.4285
cc 1
eloc 4
nc 1
nop 3
1
<?php
2
3
namespace Victoire\Bundle\I18nBundle\Entity;
4
5
use Doctrine\ORM\Mapping as ORM;
6
use Gedmo\Translatable\Entity\MappedSuperclass\AbstractPersonalTranslation;
7
8
/**
9
 * @ORM\Entity
10
 * @ORM\Table(name="vic_view_translations_legacy",
11
 *     uniqueConstraints={@ORM\UniqueConstraint(name="lookup_unique_idx", columns={
12
 *         "locale", "object_id", "field"
13
 *     })}
14
 * )
15
 */
16
class ViewTranslationLegacy extends AbstractPersonalTranslation
17
{
18
    /**
19
     * Convenient constructor.
20
     *
21
     * @param string $locale
22
     * @param string $field
23
     * @param string $value
24
     */
25
    public function __construct($locale = null, $field = null, $value = null)
26
    {
27
        $this->setLocale($locale);
28
        $this->setField($field);
29
        $this->setContent($value);
30
    }
31
32
    /**
33
     * @ORM\ManyToOne(targetEntity="Victoire\Bundle\CoreBundle\Entity\View", inversedBy="translations")
34
     * @ORM\JoinColumn(name="object_id", referencedColumnName="id", onDelete="CASCADE")
35
     */
36
    protected $object;
37
}
38