Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Symfony Assert Annotations using external Class constants
<?php
namespace Sps\Bundle\PriceQuoteBundle\Entity;
abstract class AbstractDormerPriceQuote
extends PriceQuoteRequest
{
const MIN_ROOF_PITCH = 10;
const MAX_ROOF_PITCH = 55;
}
<?php
namespace Sps\PriceQuote\Application\Command;
use Sps\Bundle\PriceQuoteBundle\Entity\AbstractDormerPriceQuote;
class AbstractRequestPriceQuoteCommand
{
/**
* @var $roofPitch
* @Assert\Range(min=AbstractDormerPriceQuote::MIN_ROOF_PITCH, max="55", groups={
* "flow_dormerRequest_step4", "glasDormerRequest"
* })
*/
public $roofPitch;
@webdevilopers
Copy link
Author

webdevilopers commented Dec 3, 2016

@webdevilopers
Copy link
Author

webdevilopers commented Dec 3, 2016

Fixed:

    /**
     * @var $roofPitch
     * @Assert\Range(min=AbstractDormerPriceQuote::MIN_ROOF_PITCH, max="55", groups={
     *  "flow_dormerRequest_step4", "glasDormerRequest"
     * })
     */
    public $roofPitch;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment