private static function calculateGrandCycle($year) {
        
        $endOfFirstGrandCycle = static::GRAND_CYCLE_BEGINNING + static::GRAND_CYCLE_LENGTH;
        
        // by default we are in the first grand cycle
        $grandCycle = 0;
        if ($year < static::GRAND_CYCLE_BEGINNING) {
            
            $beginningYear = static::GRAND_CYCLE_BEGINNING;
            while ($year < $beginningYear) {
                $beginningYear -= static::GRAND_CYCLE_LENGTH;
                $grandCycle--;
            }
            
        } elseif ($year >= $endOfFirstGrandCycle) {
            
            $beginningYear = $endOfFirstGrandCycle;
            while ($year >= $beginningYear) {
                $beginningYear += static::GRAND_CYCLE_LENGTH;
                $grandCycle++;
            }
        }
        
        return $grandCycle;
    }
private static function calculateGrandCycle($year) {
        
        $endOfFirstGrandCycle = static::GRAND_CYCLE_BEGINNING + static::GRAND_CYCLE_LENGTH;
        
        // by default we are in the first grand cycle
        $grandCycle = 0;
        if ($year < static::GRAND_CYCLE_BEGINNING) {
            
            $beginningYear = static::GRAND_CYCLE_BEGINNING;
            while ($year < $beginningYear) {
                $beginningYear -= static::GRAND_CYCLE_LENGTH;
                $grandCycle--;
            }
            
        } elseif ($year >= $endOfFirstGrandCycle) {
            
            $beginningYear = $endOfFirstGrandCycle;
            while ($year >= $beginningYear) {
                $beginningYear += static::GRAND_CYCLE_LENGTH;
                $grandCycle++;
            }
        }
        
        return $grandCycle;
    }
private static function calculateGrandCycle ( $ year ) { $ endOfFirstGrandCycle = static :: GRAND_CYCLE_BEGINNING + static :: GRAND_CYCLE_LENGTH ; // by default we are in the first grand cycle $ grandCycle = 0 ; if ( $ year < static :: GRAND_CYCLE_BEGINNING ) { $ beginningYear = static :: GRAND_CYCLE_BEGINNING ; while ( $ year < $ beginningYear ) { $ beginningYear -= static :: GRAND_CYCLE_LENGTH ; $ grandCycle -- ; } } elseif ( $ year >= $ endOfFirstGrandCycle ) { $ beginningYear = $ endOfFirstGrandCycle ; while ( $ year >= $ beginningYear ) { $ beginningYear += static :: GRAND_CYCLE_LENGTH ; $ grandCycle ++ ; } } return $ grandCycle ; }
calculate that which grand cycle we are in

@param int $year the year in jalali calendar

@return int
calculate that which grand cycle we are in