_data['password'])) { unset($this->_data['password']); } else { $this->_data['salt'] = substr(md5(time()), 0, 8); $this->_data['password'] = $this->_encryptPass($this->_data['password'], $this->_data['salt']); } } protected function _getFromColumns() { $columns = parent::_getFromColumns(); $columns['documentsCount'] = $this->_getDocumentsCountExpr(); return $columns; } protected function _getDocumentsCountExpr() { $select = $this->_db->select(); $select->from($this->_getPair('ApplicationDocument'), array(new Zend_Db_Expr('COUNT(`ApplicationDocument`.`id`)'))); $select->where('`ApplicationDocument`.`applicationUserId` = `' . $this->_tableAlias . '`.`id`'); return new Zend_Db_Expr('(' . $select . ')'); } }