SubscriptionTranslation   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 22
rs 10
c 0
b 0
f 0
wmc 1
lcom 0
cbo 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
1
<?php
2
3
/**
4
 * @author Rafał Muszyński <[email protected]>
5
 * @copyright 2015 Sourcefabric z.ú.
6
 * @license http://www.gnu.org/licenses/gpl-3.0.txt
7
 */
8
9
namespace Newscoop\PaywallBundle\Entity;
10
11
use Doctrine\ORM\Mapping as ORM;
12
use Gedmo\Translatable\Entity\MappedSuperclass\AbstractPersonalTranslation;
13
14
/**
15
 * @ORM\Entity(repositoryClass="Gedmo\Translatable\Entity\Repository\TranslationRepository")
16
 * @ORM\Table(name="plugin_paywall_subscription_translation",
17
 *     uniqueConstraints={@ORM\UniqueConstraint(name="lookup_unique_idx", columns={
18
 *         "locale", "object_id", "field"
19
 *     })}
20
 * )
21
 */
22
class SubscriptionTranslation extends AbstractPersonalTranslation
23
{
24
    /**
25
     * Constructor.
26
     *
27
     * @param string $locale
28
     * @param string $field
29
     * @param string $value
30
     */
31
    public function __construct($locale, $field, $value)
32
    {
33
        $this->setLocale($locale);
34
        $this->setField($field);
35
        $this->setContent($value);
36
    }
37
38
    /**
39
     * @ORM\ManyToOne(targetEntity="Subscription", inversedBy="translations", cascade={"persist"})
40
     * @ORM\JoinColumn(name="object_id", referencedColumnName="id", onDelete="CASCADE")
41
     */
42
    protected $object;
43
}
44