['title', 'description']]; protected function _getFromColumns() { $columns = parent::_getFromColumns(); $columns['slidesCount'] = new Zend_Db_Expr('(' . $this->getSlidesCountSubSelect() . ')'); $columns['hasEnabledSlides'] = TrainingModel::getTestSlideExists('t.id'); return $columns; } protected function getSlidesCountSubSelect() { $select = $this->_db->select(); $select->from($this->_getPair('TestSlide', 'ts'), 'COUNT(*)'); $select->where('`ts`.`testId` = `t`.`id`'); return $select; } public static function get4Select() { $table = new Qs_Db_Table('Test'); return $table->get4Select(['id', 'title'], ['enabled = ?' => 'y'], 'title'); } }