protected function _getCount(array $config, array $conditions)
    {
        $finder = 'all';
        if (!empty($config['finder'])) {
            $finder = $config['finder'];
            unset($config['finder']);
        }

        if (!isset($config['conditions'])) {
            $config['conditions'] = [];
        }
        $config['conditions'] = array_merge($conditions, $config['conditions']);
        $query = $this->_table->find($finder, $config);

        return $query->count();
    }
protected function _getCount(array $config, array $conditions)
    {
        $finder = 'all';
        if (!empty($config['finder'])) {
            $finder = $config['finder'];
            unset($config['finder']);
        }

        if (!isset($config['conditions'])) {
            $config['conditions'] = [];
        }
        $config['conditions'] = array_merge($conditions, $config['conditions']);
        $query = $this->_table->find($finder, $config);

        return $query->count();
    }
protected function _getCount ( array $ config , array $ conditions ) { $ finder = 'all' ; if ( ! empty ( $ config [ 'finder' ] ) ) { $ finder = $ config [ 'finder' ] ; unset ( $ config [ 'finder' ] ) ; } if ( ! isset ( $ config [ 'conditions' ] ) ) { $ config [ 'conditions' ] = [ ] ; } $ config [ 'conditions' ] = array_merge ( $ conditions , $ config [ 'conditions' ] ) ; $ query = $ this -> _table -> find ( $ finder , $ config ) ; return $ query -> count ( ) ; }
Fetches and returns the count for a single field in an association

@param array $config The counter cache configuration for a single field
@param array $conditions Additional conditions given to the query
@return int The number of relations matching the given config and conditions
Fetches and returns the count for a single field in an association