public function GetCountItemsByJoinEntity($sEntityJoin, $sKeyJoin, $sRelationKey, $aRelationValues, $aFilter, $sEntityFull = null)
 {
     $sEntityFull = $this->_NormalizeEntityRootName($sEntityFull);
     /**
      * Кеширование
      * Если параметр #cache указан и пуст, значит игнорируем кэширование для запроса
      */
     if (array_key_exists('#cache', $aFilter) && !$aFilter['#cache']) {
         $iCount = $this->oMapperORM->GetCountItemsByJoinEntity($sEntityJoin, $sKeyJoin, $sRelationKey, $aRelationValues, $aFilter, $sEntityFull);
     } else {
         $sEntityJoin = $this->Plugin_GetRootDelegater('entity', $sEntityJoin);
         $sCacheKey = 'count_items_by_join_entity_' . serialize(array($sEntityJoin, $sKeyJoin, $sRelationKey, $aRelationValues, $aFilter, $sEntityFull));
         /**
          * Формируем теги для сброса кеша
          * Сброс идет по обновлению таблицы связей
          */
         $aCacheTags = array($sEntityJoin . '_save', $sEntityJoin . '_delete');
         $iCacheTime = 60 * 60 * 24;
         // todo: скорее лучше хранить в свойстве сущности, для возможности выборочного переопределения
         /**
          * Переопределяем из параметров
          */
         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 === ($iCount = $this->Cache_Get($sCacheKey))) {
             $iCount = $this->oMapperORM->GetCountItemsByJoinEntity($sEntityJoin, $sKeyJoin, $sRelationKey, $aRelationValues, $aFilter, $sEntityFull);
             $this->Cache_Set($iCount, $sCacheKey, $aCacheTags, $iCacheTime);
         }
     }
     return $iCount;
 }