getActiveIndividualsCountExpr(); return $columns; } protected function getActiveIndividualsCountExpr() { $select = $this->_db->select(); $select->from($this->_getPair('User'), 'COUNT(*)') ->where('`User`.`companyId` = `' . $this->_getTableAlias() . '`.`id`') ->where('`User`.`status` = ?', UserEntity::STATUS_ACTIVE); return new Zend_Db_Expr('(' . $select . ')'); } public function addStateFullname(Zend_Db_Select $select) { $select->join( $this->_getPair('DState', 'state'), '`state`.`id` = ' . $this->_getTableAlias() . '.state', ['stateFull' => 'title'] ); return $this; } }