Register style can be skipped when already registered

This commit is contained in:
Antoine Lamirault authored and Adrien Loison committed 2021-03-30 19:42:21 +02:00
1 parent a58b340835
commit 197fb9987a
9 files changed
+84 -31

No files matched your search

+22
View File
@@ -84,6 +84,9 @@ class Style
/** @var bool */
private $hasSetFormat = false;
/** @var bool */
private $isRegistered = false;
/**
* @return int|null
*/
@@ -463,4 +466,23 @@ class Style
{
return $this->hasSetFormat;
}
public function setRegistered(bool $isRegistered = true) : void
{
$this->isRegistered = $isRegistered;
}
/**
* @return bool
*/
public function isRegistered() : bool
{
return $this->isRegistered;
}
public function register(int $id) : void
{
$this->setId($id);
$this->isRegistered = true;
}
}