public function year($value = null)
    {
        if ($value !== null) {
            if ($value < 0 || $value > 9999) {
                $this->year = 0;
            } else {
                $this->year = $value;
            }
        }
        return $this->year;
    }
public function year($value = null)
    {
        if ($value !== null) {
            if ($value < 0 || $value > 9999) {
                $this->year = 0;
            } else {
                $this->year = $value;
            }
        }
        return $this->year;
    }
public function year ( $ value = null ) { if ( $ value !== null ) { if ( $ value < 0 || $ value > 9999 ) { $ this -> year = 0 ; } else { $ this -> year = $ value ; } } return $ this -> year ; }
Set the year field of the date object

@param   int     the year
@return  int     the year
Set the year field of the date object