select; } $columns = array( '*', 'image' => new Zend_Db_Expr("IF(`{$this->_tableAlias}`.`type` = 'image', `{$this->_tableAlias}`.`image`, `{$this->_tableAlias}`.`backgroundImage`)") ); $select->from($this->pair, $columns); return $select; } protected function _join(Zend_Db_Select $select = null) { $select = parent::_join($select); $select->join( $this->pairDBannerType, "`DBannerType`.`id` = `{$this->_tableAlias}`.`type`", array('typeTitle' => 'title') ); return $select; } }