for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Loevgaard\SyliusBarcodePlugin\Model;
use DateTime;
trait ProductVariantTrait
{
/**
* @var string|null
*/
protected $barcode;
* The date where the barcode was checked
*
* @var DateTime|null
protected $barcodeChecked;
* @var bool
protected $barcodeValid = false;
* {@inheritdoc}
public function getBarcode(): ?string
return $this->barcode;
}
public function setBarcode(?string $barcode): void
$this->barcode = $barcode;
public function isBarcodeChecked(): bool
return $this->barcodeChecked instanceof DateTime;
public function getBarcodeChecked(): ?DateTime
return $this->barcodeChecked;
public function setBarcodeChecked(?DateTime $barcodeChecked): void
$this->barcodeChecked = $barcodeChecked;
* @return bool
public function isBarcodeValid(): bool
return $this->barcodeValid;
* @param bool $barcodeValid
public function setBarcodeValid(bool $barcodeValid): void
$this->barcodeValid = $barcodeValid;
public function markBarcodeAsChecked(bool $valid): void
$this->barcodeChecked = new DateTime();
$this->barcodeValid = $valid;