Item   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 56
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 6
Bugs 0 Features 1
Metric Value
wmc 4
c 6
b 0
f 1
lcom 0
cbo 0
dl 0
loc 56
ccs 0
cts 18
cp 0
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A setId() 0 5 1
A getId() 0 4 1
A setItem() 0 5 1
A getItem() 0 4 1
1
<?php
2
/**
3
 * AnimeDb package
4
 *
5
 * @package   AnimeDb
6
 * @author    Peter Gribanov <[email protected]>
7
 * @copyright Copyright (c) 2011, Peter Gribanov
8
 * @license   http://opensource.org/licenses/GPL-3.0 GPL v3
9
 */
10
11
namespace AnimeDb\Bundle\MyAnimeListSyncBundle\Entity;
12
13
use Doctrine\ORM\Mapping as ORM;
14
use AnimeDb\Bundle\CatalogBundle\Entity\Item as CatalogItem;
15
16
/**
17
 * Items in MyAnimeList
18
 *
19
 * @ORM\Entity(repositoryClass="AnimeDb\Bundle\MyAnimeListSyncBundle\Repository\ItemRepository")
20
 * @ORM\Table(
21
 *   name="my_anime_list_item",
22
 *   uniqueConstraints={
23
 *     @ORM\UniqueConstraint(name="my_anime_list_item_idx", columns={"mal_item_id", "item_id"})
24
 *   }
25
 * )
26
 *
27
 * @package AnimeDb\Bundle\MyAnimeListSyncBundle\Entity
28
 * @author  Peter Gribanov <[email protected]>
29
 */
30
class Item
31
{
32
    /**
33
     * @ORM\Id
34
     * @ORM\Column(type="integer", name="mal_item_id")
35
     *
36
     * @var int
37
     */
38
    protected $id;
39
40
    /**
41
     * @ORM\OneToOne(targetEntity="AnimeDb\Bundle\CatalogBundle\Entity\Item")
42
     * @ORM\JoinColumn(name="item_id", referencedColumnName="id", nullable=false)
43
     *
44
     * @var CatalogItem
45
     */
46
    protected $item;
47
48
    /**
49
     * @param int $id
50
     *
51
     * @return Item
52
     */
53
    public function setId($id)
54
    {
55
        $this->id = $id;
56
        return $this;
57
    }
58
59
    /**
60
     * @return int
61
     */
62
    public function getId()
63
    {
64
        return $this->id;
65
    }
66
67
    /**
68
     * @param CatalogItem $item
69
     *
70
     * @return Item
71
     */
72
    public function setItem(CatalogItem $item)
73
    {
74
        $this->item = $item;
75
        return $this;
76
    }
77
78
    /**
79
     * @return CatalogItem
80
     */
81
    public function getItem()
82
    {
83
        return $this->item;
84
    }
85
}
86