public function evaluateLimits($limitRules = [], $campaignId = 0, $break = true, $name = true)
    {
        $limitRules = $this->mergeRules($limitRules, false);
        $limits     = $this->getRepository()->findLimits(
            $this->contactSource,
            $limitRules,
            $campaignId,
            $this->getTimezone(),
            $break,
            $name
        );
        if ($break) {
            foreach ($limits as $limit) {
                if (isset($limit['hit']) && true === $limit['hit']) {
                    throw new ContactSourceException(
                        'Cap exceeded'.!empty($limit['name']) ? ': '.$limit['name'] : '.',
                        Codes::HTTP_TOO_MANY_REQUESTS,
                        null,
                        Stat::TYPE_LIMITED,
                        false,
                        $limit
                    );
                }
            }
        }

        return $limits;
    }
public function evaluateLimits($limitRules = [], $campaignId = 0, $break = true, $name = true)
    {
        $limitRules = $this->mergeRules($limitRules, false);
        $limits     = $this->getRepository()->findLimits(
            $this->contactSource,
            $limitRules,
            $campaignId,
            $this->getTimezone(),
            $break,
            $name
        );
        if ($break) {
            foreach ($limits as $limit) {
                if (isset($limit['hit']) && true === $limit['hit']) {
                    throw new ContactSourceException(
                        'Cap exceeded'.!empty($limit['name']) ? ': '.$limit['name'] : '.',
                        Codes::HTTP_TOO_MANY_REQUESTS,
                        null,
                        Stat::TYPE_LIMITED,
                        false,
                        $limit
                    );
                }
            }
        }

        return $limits;
    }
public function evaluateLimits ( $ limitRules = [ ] , $ campaignId = 0 , $ break = true , $ name = true ) { $ limitRules = $ this -> mergeRules ( $ limitRules , false ) ; $ limits = $ this -> getRepository ( ) -> findLimits ( $ this -> contactSource , $ limitRules , $ campaignId , $ this -> getTimezone ( ) , $ break , $ name ) ; if ( $ break ) { foreach ( $ limits as $ limit ) { if ( isset ( $ limit [ 'hit' ] ) && true === $ limit [ 'hit' ] ) { throw new ContactSourceException ( 'Cap exceeded' . ! empty ( $ limit [ 'name' ] ) ? ': ' . $ limit [ 'name' ] : '.' , Codes :: HTTP_TOO_MANY_REQUESTS , null , Stat :: TYPE_LIMITED , false , $ limit ) ; } } } return $ limits ; }
Using the limit rules, evaluate if the current campaign exceeds limits.

@param array $limitRules
@param int   $campaignId
@param bool  $break
@param bool  $name

@return array

@throws ContactSourceException
@throws \Exception
Using the limit rules evaluate if the current campaign exceeds limits .