Completed
Pull Request — 3.x (#246)
by
unknown
13:12
created

BaseMessage::__clone()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 0
1
<?php
2
3
/*
4
 * This file is part of the Sonata Project package.
5
 *
6
 * (c) Salma Khemiri Chakroun <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Sonata\NotificationBundle\Document;
13
14
use Sonata\NotificationBundle\Model\Message;
15
16
class BaseMessage extends Message
17
{
18
    /**
19
     * @var \MongoId
20
     */
21
    protected $id;
22
23
    /**
24
     * Override clone in order to avoid duplicating entries in Doctrine
25
     */
26
    public function __clone()
27
    {
28
        parent::__clone();
29
30
        $this->id = null;
31
    }
32
33
    /**
34
     * Get id
35
     *
36
     * @return \MongoId $id
37
     */
38
    public function getId()
39
    {
40
        return $this->id;
41
    }
42
}
43