Skip to content

Commit 4e88ae1

Browse files
committed
ISSUE-337: fix cache clear
1 parent 9fb7e83 commit 4e88ae1

File tree

8 files changed

+285
-706
lines changed

8 files changed

+285
-706
lines changed

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@
8181
"PhpList\\Core\\Composer\\ScriptHandler::createBundleConfiguration",
8282
"PhpList\\Core\\Composer\\ScriptHandler::createRoutesConfiguration",
8383
"PhpList\\Core\\Composer\\ScriptHandler::createParametersConfiguration",
84-
"php bin/console cache:clear"
84+
"php bin/console cache:clear --env=prod",
85+
"php bin/console cache:warmup --env=prod"
8586
],
8687
"post-install-cmd": [
8788
"@update-configuration"

src/Domain/Model/Identity/Administrator.php

Lines changed: 30 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
<?php
2+
23
declare(strict_types=1);
34

45
namespace PhpList\Core\Domain\Model\Identity;
56

6-
use Doctrine\ORM\Mapping;
7-
use Doctrine\ORM\Mapping\Column;
7+
use DateTime;
8+
use Doctrine\ORM\Mapping as ORM;
89
use PhpList\Core\Domain\Model\Interfaces\CreationDate;
910
use PhpList\Core\Domain\Model\Interfaces\DomainModel;
1011
use PhpList\Core\Domain\Model\Interfaces\Identity;
@@ -16,174 +17,100 @@
1617
/**
1718
* This class represents an administrator who can log to the system, is allowed to administer
1819
* selected lists (as the owner), send campaigns to these lists and edit subscribers.
19-
*
20-
* @Mapping\Entity(repositoryClass="PhpList\Core\Domain\Repository\Identity\AdministratorRepository")
21-
* @Mapping\Table(name="phplist_admin")
22-
* @Mapping\HasLifecycleCallbacks
23-
*
24-
* @author Oliver Klee <[email protected]>
2520
*/
21+
#[ORM\Entity(repositoryClass: "PhpList\Core\Domain\Repository\Identity\AdministratorRepository")]
22+
#[ORM\Table(name: "phplist_admin")]
23+
#[ORM\HasLifecycleCallbacks]
2624
class Administrator implements DomainModel, Identity, CreationDate, ModificationDate
2725
{
2826
use IdentityTrait;
2927
use CreationDateTrait;
3028
use ModificationDateTrait;
3129

32-
/**
33-
* @var string
34-
* @Column(name="loginname")
35-
*/
36-
private $loginName = '';
30+
#[ORM\Column(name: "loginname")]
31+
private string $loginName = '';
3732

38-
/**
39-
* @var string
40-
* @Column(name="email")
41-
*/
42-
private $emailAddress = '';
33+
#[ORM\Column(name: "email")]
34+
private string $emailAddress = '';
4335

44-
/**
45-
* @var \DateTime|null
46-
* @Column(type="datetime", name="created")
47-
*/
48-
protected $creationDate = null;
36+
#[ORM\Column(name: "created", type: "datetime")]
37+
protected ?DateTime $creationDate = null;
4938

50-
/**
51-
* @var \DateTime|null
52-
* @Column(type="datetime", name="modified")
53-
*/
54-
protected $modificationDate = null;
39+
#[ORM\Column(name: "modified", type: "datetime")]
40+
protected ?DateTime $modificationDate = null;
5541

56-
/**
57-
* @var string
58-
* @Column(name="password")
59-
*/
60-
private $passwordHash = '';
42+
#[ORM\Column(name: "password")]
43+
private string $passwordHash = '';
6144

62-
/**
63-
* @var \DateTime|null
64-
* @Column(type="date", nullable=true, name="passwordchanged")
65-
*/
66-
private $passwordChangeDate = null;
45+
#[ORM\Column(name: "passwordchanged", type: "date", nullable: true)]
46+
private ?DateTime $passwordChangeDate = null;
6747

68-
/**
69-
* @var bool
70-
* @Column(type="boolean")
71-
*/
72-
private $disabled = false;
48+
#[ORM\Column(type: "boolean")]
49+
private bool $disabled = false;
7350

74-
/**
75-
* @var bool
76-
* @Column(type="boolean", name="superuser")
77-
*/
78-
private $superUser = false;
51+
#[ORM\Column(name: "superuser", type: "boolean")]
52+
private bool $superUser = false;
7953

80-
/**
81-
* @return string
82-
*/
8354
public function getLoginName(): string
8455
{
8556
return $this->loginName;
8657
}
8758

88-
/**
89-
* @param string $loginName
90-
*
91-
* @return void
92-
*/
93-
public function setLoginName(string $loginName)
59+
public function setLoginName(string $loginName): void
9460
{
9561
$this->loginName = $loginName;
9662
}
9763

98-
/**
99-
* @return string
100-
*/
10164
public function getEmailAddress(): string
10265
{
10366
return $this->emailAddress;
10467
}
10568

106-
/**
107-
* @param string $emailAddress
108-
*
109-
* @return void
110-
*/
111-
public function setEmailAddress(string $emailAddress)
69+
public function setEmailAddress(string $emailAddress): void
11270
{
11371
$this->emailAddress = $emailAddress;
11472
}
11573

116-
/**
117-
* @return string
118-
*/
11974
public function getPasswordHash(): string
12075
{
12176
return $this->passwordHash;
12277
}
12378

12479
/**
12580
* Sets the password hash and updates the password change date to now.
126-
*
127-
* @param string $passwordHash
128-
*
129-
* @return void
13081
*/
131-
public function setPasswordHash(string $passwordHash)
82+
public function setPasswordHash(string $passwordHash): void
13283
{
13384
$this->passwordHash = $passwordHash;
134-
$this->setPasswordChangeDate(new \DateTime());
85+
$this->setPasswordChangeDate(new DateTime());
13586
}
13687

137-
/**
138-
* @return \DateTime|null
139-
*/
140-
public function getPasswordChangeDate()
88+
public function getPasswordChangeDate(): ?DateTime
14189
{
14290
return $this->passwordChangeDate;
14391
}
14492

145-
/**
146-
* @param \DateTime $changeDate
147-
*
148-
* @return void
149-
*/
150-
private function setPasswordChangeDate(\DateTime $changeDate)
93+
private function setPasswordChangeDate(DateTime $changeDate): void
15194
{
15295
$this->passwordChangeDate = $changeDate;
15396
}
15497

155-
/**
156-
* @return bool
157-
*/
15898
public function isDisabled(): bool
15999
{
160100
return $this->disabled;
161101
}
162102

163-
/**
164-
* @param bool $disabled
165-
*
166-
* @return void
167-
*/
168-
public function setDisabled(bool $disabled)
103+
public function setDisabled(bool $disabled): void
169104
{
170105
$this->disabled = $disabled;
171106
}
172107

173-
/**
174-
* @return bool
175-
*/
176108
public function isSuperUser(): bool
177109
{
178110
return $this->superUser;
179111
}
180112

181-
/**
182-
* @param bool $superUser
183-
*
184-
* @return void
185-
*/
186-
public function setSuperUser(bool $superUser)
113+
public function setSuperUser(bool $superUser): void
187114
{
188115
$this->superUser = $superUser;
189116
}

0 commit comments

Comments
 (0)