Zend - No property exists by the name ''
What I'm trying to do is to check if the year of the date sent from the form has the right value. The right values are given my the plan year given as a parameter in the constructor of the validator.

I get the message from the title with the next custom validator. It's because variable $this->$plan_year, but I don't undestand why. This is the validator:
    <?php 

    class MyValidate_YearValidator extends Zend_Validate_Abstract
    {
	    const MSG_YEAR = '';

	    private $plan_year = 0;
	
	    public $minimum = 0;
	    public $maximum = 0;
	
	    protected $_messageVariables = array(
			'min' => 'minimum',
			'max' => 'maximum'
	    );

	    protected $_messageTemplates = array(
			self::MSG_YEAR => "Valoarea '%value%' nu este corecta! Anul trebuie sa aibe una din urmatoarele doua valori: '%min%' sau '%max%'."
	    );
	
	    public function __construct( $plan_year )
	    {
		    $this->$plan_year = $plan_year;
		
	    }

	    public function isValid($value)
	    {
		
		    $this->_setValue($value);
		
		    $anul = substr($value, 0, 4);
		
		    //here is the problem
		    $this->minimum = $this->$plan_year;
		    $this->maximum = $this->$plan_year + 1;
				
		    if ($anul <> $this->minimum && $anul <> $this->maximum && $value != '') {
			    $this->_error(self::MSG_YEAR);
			    return false;
		    }
		
		    return true;
	    }
    }

Thank you!
Sorin
Zend - No property exists by the name ''
===

What I'm trying to do is to check if the year of the date sent from the form has the right value. The right values are given my the plan year given as a parameter in the constructor of the validator.

I get the message from the title with the next custom validator. It's because variable $this->$plan_year, but I don't undestand why. This is the validator:
    <?php 

    class MyValidate_YearValidator extends Zend_Validate_Abstract
    {
	    const MSG_YEAR = '';

	    private $plan_year = 0;
	
	    public $minimum = 0;
	    public $maximum = 0;
	
	    protected $_messageVariables = array(
			'min' => 'minimum',
			'max' => 'maximum'
	    );

	    protected $_messageTemplates = array(
			self::MSG_YEAR => "Valoarea '%value%' nu este corecta! Anul trebuie sa aibe una din urmatoarele doua valori: '%min%' sau '%max%'."
	    );
	
	    public function __construct( $plan_year )
	    {
		    $this->$plan_year = $plan_year;
		
	    }

	    public function isValid($value)
	    {
		
		    $this->_setValue($value);
		
		    $anul = substr($value, 0, 4);
		
		    //here is the problem
		    $this->minimum = $this->$plan_year;
		    $this->maximum = $this->$plan_year + 1;
				
		    if ($anul <> $this->minimum && $anul <> $this->maximum && $value != '') {
			    $this->_error(self::MSG_YEAR);
			    return false;
		    }
		
		    return true;
	    }
    }

Thank you!
Sorin