protected function getCountCommon($data = array())
    {
        parent::getCountCommon($data);

        // --------------------------------------------------------------------------

        $oDb = Factory::service('Database');
        $oDb->select($this->tableAlias . '.*');

        if (!empty($data['include_count'])) {

            $subQuery = '
                SELECT
                    COUNT(DISTINCT post_id)
                FROM ' . NAILS_DB_PREFIX . 'blog_post_category
                WHERE
                category_id = ' . $this->tableAlias . '.id';

            $oDb->select('(' . $subQuery . ') post_count');
        }

        //  Default sort
        if (empty($data['sort'])) {

            $oDb->order_by($this->tableAlias . '.label');
        }
    }
protected function getCountCommon($data = array())
    {
        parent::getCountCommon($data);

        // --------------------------------------------------------------------------

        $oDb = Factory::service('Database');
        $oDb->select($this->tableAlias . '.*');

        if (!empty($data['include_count'])) {

            $subQuery = '
                SELECT
                    COUNT(DISTINCT post_id)
                FROM ' . NAILS_DB_PREFIX . 'blog_post_category
                WHERE
                category_id = ' . $this->tableAlias . '.id';

            $oDb->select('(' . $subQuery . ') post_count');
        }

        //  Default sort
        if (empty($data['sort'])) {

            $oDb->order_by($this->tableAlias . '.label');
        }
    }
protected function getCountCommon ( $ data = array ( ) ) { parent :: getCountCommon ( $ data ) ; // -------------------------------------------------------------------------- $ oDb = Factory :: service ( 'Database' ) ; $ oDb -> select ( $ this -> tableAlias . '.*' ) ; if ( ! empty ( $ data [ 'include_count' ] ) ) { $ subQuery = '
                SELECT
                    COUNT(DISTINCT post_id)
                FROM ' . NAILS_DB_PREFIX . 'blog_post_category
                WHERE
                category_id = ' . $ this -> tableAlias . '.id' ; $ oDb -> select ( '(' . $ subQuery . ') post_count' ) ; } //  Default sort if ( empty ( $ data [ 'sort' ] ) ) { $ oDb -> order_by ( $ this -> tableAlias . '.label' ) ; } }
Set some common data
@param  array $data Data passed from the calling method
@return void
Set some common data