/**
  * @return string
  * @throws NotSupportedException if the displayElementType is not Date or DateTime, which means it is invalid
  */
 protected function getDateOrDateTimeRulesClassName()
 {
     $displayElementType = $this->modelRelationsAndAttributesToReportAdapter->getDisplayElementType($this->filter->getResolvedAttribute());
     if ($displayElementType == 'Date') {
         return 'MixedDateTypesSearchFormAttributeMappingRules';
     } elseif ($displayElementType == 'DateTime') {
         return 'MixedDateTimeTypesSearchFormAttributeMappingRules';
     } else {
         throw new NotSupportedException();
     }
 }
 /**
  * @param string $attribute
  * @return string
  * @throws NotSupportedException if the attribute is an invalid display calculation
  */
 public function getDisplayElementType($attribute)
 {
     assert('is_string($attribute)');
     if ($this->isAttributeIndexOrDerivedTypeADisplayCalculation($attribute)) {
         if ($attribute == self::DISPLAY_CALCULATION_COUNT) {
             return 'Integer';
         }
         list($realAttribute, $notUsed) = explode(FormModelUtil::DELIMITER, $attribute);
         $attributeType = ModelAttributeToMixedTypeUtil::getType($this->model, $realAttribute);
         if ($attributeType == 'Decimal' || $attributeType == 'Integer') {
             return 'Decimal';
         } elseif ($attributeType == 'Date') {
             return 'Date';
         } elseif ($attributeType == 'DateTime') {
             return 'DateTime';
         } elseif ($this->model->isRelation($realAttribute) && $this->model->getRelationModelClassName($realAttribute) == 'CurrencyValue') {
             return 'CalculatedCurrencyValue';
         } else {
             throw new NotSupportedException();
         }
     } elseif ($this->isAttributeACalculatedGroupByModifier($attribute) && $this->getGroupByCalculationTypeByAttribute($attribute) == self::GROUP_BY_CALCULATION_MONTH) {
         return 'GroupByModifierMonth';
     } elseif ($this->isAttributeACalculatedGroupByModifier($attribute)) {
         return 'Text';
     }
     return parent::getDisplayElementType($attribute);
 }