Completed
Push — master ( 08dfdd...90dc94 )
by Axel
28:22 queued 23:20
created

StandardFieldsTrait::setUpdatedDate()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 3
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the Zikula package.
7
 *
8
 * Copyright Zikula Foundation - https://ziku.la/
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace Zikula\CategoriesModule\Traits;
15
16
use DateTimeInterface;
17
use Doctrine\ORM\Mapping as ORM;
18
use Gedmo\Mapping\Annotation as Gedmo;
19
use Zikula\UsersModule\Entity\UserEntity;
20
21
/**
22
 * Standard fields trait.
23
 */
24
trait StandardFieldsTrait
25
{
26
    /**
27
     * The user id of the creator of this entity
28
     *
29
     * @var UserEntity
30
     * @Gedmo\Blameable(on="create")
31
     * @ORM\ManyToOne(targetEntity="Zikula\UsersModule\Entity\UserEntity")
32
     * @ORM\JoinColumn(name="cr_uid", referencedColumnName="uid")
33
     */
34
    protected $createdBy;
35
36
    /**
37
     * The creation timestamp of this entity
38
     *
39
     * @var DateTime
0 ignored issues
show
Bug introduced by
The type Zikula\CategoriesModule\Traits\DateTime was not found. Did you mean DateTime? If so, make sure to prefix the type with \.
Loading history...
40
     * @ORM\Column(type="datetime", name="cr_date")
41
     * @Gedmo\Timestampable(on="create")
42
     */
43
    protected $createdDate;
44
45
    /**
46
     * The user id of the last update of this entity
47
     *
48
     * @var UserEntity
49
     * @Gedmo\Blameable(on="update")
50
     * @ORM\ManyToOne(targetEntity="Zikula\UsersModule\Entity\UserEntity")
51
     * @ORM\JoinColumn(name="lu_uid", referencedColumnName="uid")
52
     */
53
    protected $updatedBy;
54
55
    /**
56
     * The last updated timestamp of this entity
57
     *
58
     * @var DateTime
59
     * @ORM\Column(type="datetime", name="lu_date")
60
     * @Gedmo\Timestampable(on="update")
61
     */
62
    protected $updatedDate;
63
64
    public function getCreatedBy(): UserEntity
65
    {
66
        return $this->createdBy;
67
    }
68
69
    public function setCreatedBy(UserEntity $createdBy): void
70
    {
71
        $this->createdBy = $createdBy;
72
    }
73
74
    public function getCreatedDate(): DateTimeInterface
75
    {
76
        return $this->createdDate;
77
    }
78
79
    public function setCreatedDate(DateTimeInterface $createdDate): void
80
    {
81
        $this->createdDate = $createdDate;
0 ignored issues
show
Documentation Bug introduced by
It seems like $createdDate of type DateTimeInterface is incompatible with the declared type Zikula\CategoriesModule\Traits\DateTime of property $createdDate.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
82
    }
83
84
    public function getUpdatedBy(): UserEntity
85
    {
86
        return $this->updatedBy;
87
    }
88
89
    public function setUpdatedBy(UserEntity $updatedBy): void
90
    {
91
        $this->updatedBy = $updatedBy;
92
    }
93
94
    public function getUpdatedDate(): DateTimeInterface
95
    {
96
        return $this->updatedDate;
97
    }
98
99
    public function setUpdatedDate(DateTimeInterface $updatedDate): void
100
    {
101
        $this->updatedDate = $updatedDate;
0 ignored issues
show
Documentation Bug introduced by
It seems like $updatedDate of type DateTimeInterface is incompatible with the declared type Zikula\CategoriesModule\Traits\DateTime of property $updatedDate.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
102
    }
103
}
104