_hasReason = (bool) $value; return $this; } public function hasReason() { return $this->_hasReason; } public function getReasonTitle($reasonId) { $select = $this->_db->select(); $select->from($this->_getPair('DContactReason'), 'title'); $select->where('`DContactReason`.`id` = ?', (string) $reasonId, Qs_Db::INT_TYPE); $select->limit(1); return $this->_db->fetchOne($select); } public function getListSelect() { if (null === $this->_select) { parent::getListSelect(); $this->_select->joinLeft( $this->_getPair('DContactReason'), '`DContactReason`.`id` = `' . $this->_tableAlias . '`.`idReason`', '' ); } return $this->_select; } public function getExportColumns() { $columns = parent::getExportColumns(); if (!$this->hasReason()) { unset($columns['reasonTitle']); } return $columns; } }