-
-
Save ReactiveRaven/4319737 to your computer and use it in GitHub Desktop.
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
<?php | |
// src/Acme/SubscriptionBundle/Entity/Transaction.php | |
use Symfony\Component\Validator\Constraints as Assert; | |
use Doctrine\ORM\Mapping as ORM; | |
class Transaction | |
{ | |
/** | |
* @Assert\Luhn(message = "Please check your credit card number.") | |
* @ORM\Column(type="string", length=255) | |
*/ | |
protected $cardNumber; | |
/** | |
* @ORM\OneToMany(targetEntity="User", mappedBy="transactions") | |
* @Assert\NotBlank() | |
*/ | |
protected $user; | |
/** | |
* @ORM\OneToMany(targetEntity="UserAddress") | |
* @Assert\NotBlank() | |
*/ | |
protected $address; | |
/** | |
* @ORM\ManyToMany(targetEntity="Product") | |
* @Assert\Count( | |
* min=1, | |
* max=10, | |
* minMessage="Can't charge for an empty order", | |
* maxMessage="Order is too large, ten items or fewer" | |
* ) | |
*/ | |
protected $products; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment