/**
  * Получить значение агрегирующей функции
  *
  * @param       $sAggregateFunction
  * @param       $sField
  * @param array $aFilter
  * @param null $sEntityFull
  *
  * @return EntityORM|null
  */
 public function GetAggregateFunctionByFilter($sAggregateFunction, $sField, $aFilter = array(), $sEntityFull = null)
 {
     $sEntityFull = $this->_NormalizeEntityRootName($sEntityFull);
     // Если параметр #cache указан и пуст, значит игнорируем кэширование для запроса
     if (array_key_exists('#cache', $aFilter) && !$aFilter['#cache']) {
         $iValue = $this->oMapperORM->GetAggregateFunctionByFilter($sAggregateFunction, $sField, $aFilter, $sEntityFull);
     } else {
         $sCacheKey = $sEntityFull . "_aggregate_function_by_filter_{$sAggregateFunction}_{$sField}" . serialize($aFilter);
         $aCacheTags = array($sEntityFull . '_save', $sEntityFull . '_delete');
         $iCacheTime = 60 * 60 * 24;
         // скорее лучше хранить в свойстве сущности, для возможности выборочного переопределения
         // переопределяем из параметров
         if (isset($aFilter['#cache'][0])) {
             $sCacheKey = $aFilter['#cache'][0];
         }
         if (isset($aFilter['#cache'][1])) {
             $aCacheTags = $aFilter['#cache'][1];
         }
         if (isset($aFilter['#cache'][2])) {
             $iCacheTime = $aFilter['#cache'][2];
         }
         if (false === ($iValue = $this->Cache_Get($sCacheKey))) {
             $iValue = $this->oMapperORM->GetAggregateFunctionByFilter($sAggregateFunction, $sField, $aFilter, $sEntityFull);
             $this->Cache_Set($iValue, $sCacheKey, $aCacheTags, $iCacheTime);
         }
     }
     return $iValue;
 }