|
|
@@ -276,6 +276,23 @@ abstract class ProductFamily extends AbstractDocumentEntity implements ProductPr |
|
|
|
return $this->isNovelty; |
|
|
|
} |
|
|
|
|
|
|
|
public function isNoveltyOnline(): ?bool |
|
|
|
{ |
|
|
|
if($this->isNovelty) { |
|
|
|
if($this->getNoveltyExpirationDate()) { |
|
|
|
$now = new \DateTime() ; |
|
|
|
if($now <= $this->getNoveltyExpirationDate()) { |
|
|
|
return true ; |
|
|
|
} |
|
|
|
} |
|
|
|
else { |
|
|
|
return true ; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return false ; |
|
|
|
} |
|
|
|
|
|
|
|
public function setIsNovelty(?bool $isNovelty): self |
|
|
|
{ |
|
|
|
$this->isNovelty = $isNovelty; |
|
|
@@ -295,7 +312,6 @@ abstract class ProductFamily extends AbstractDocumentEntity implements ProductPr |
|
|
|
return $this; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public function getIsOrganic(): ?bool |
|
|
|
{ |
|
|
|
return $this->isOrganic; |