generated from Setono/SyliusPluginSkeleton
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
75 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Setono\SyliusAgeVerificationPlugin\Model; | ||
|
||
interface AgeAwareProductInterface | ||
{ | ||
/** | ||
* Null means no age verification is required | ||
*/ | ||
public function getMinimumAge(): ?int; | ||
|
||
public function setMinimumAge(?int $minimumAge): void; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Setono\SyliusAgeVerificationPlugin\Model; | ||
|
||
use Doctrine\ORM\Mapping as ORM; | ||
|
||
trait AgeAwareProductTrait | ||
{ | ||
/** @ORM\Column(type="smallint", nullable=true, options={"unsigned"=true}) */ | ||
#[ORM\Column(type: 'smallint', nullable: true, options: ['unsigned' => true])] | ||
protected ?int $minimumAge = null; | ||
|
||
public function getMinimumAge(): ?int | ||
{ | ||
return $this->minimumAge; | ||
} | ||
|
||
public function setMinimumAge(?int $minimumAge): void | ||
{ | ||
$this->minimumAge = $minimumAge; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Setono\SyliusAgeVerificationPlugin\Tests\Application\Model; | ||
|
||
use Doctrine\ORM\Mapping as ORM; | ||
use Setono\SyliusAgeVerificationPlugin\Model\AgeAwareProductInterface; | ||
use Setono\SyliusAgeVerificationPlugin\Model\AgeAwareProductTrait; | ||
use Sylius\Component\Core\Model\Product as BaseProduct; | ||
|
||
/** | ||
* @ORM\Entity() | ||
* | ||
* @ORM\Table(name="sylius_product") | ||
*/ | ||
class Product extends BaseProduct implements AgeAwareProductInterface | ||
{ | ||
use AgeAwareProductTrait; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.