_user, $field, $default); } public function setUser($user) { $this->_user = $user; return $this; } protected function _getAutocompleteSelect($type = null) { $select = $this->_db->select(); $select->from($this->_getPair('User'), self::getAutocompleteColumns()); $select->where('User.`bought` = "y"'); $select->limit(10); if (in_array($type, [Obj::TYPE_EVENT, Obj::TYPE_MAIL])) { $select->where('User.`status` = "active"'); if (($userId = $this->getUser('id'))) { $select->where('User.id != ?', $userId, Qs_Db::INT_TYPE); } } if (Obj::TYPE_MAIL == $type) { $select->where('User.`pmEnabled` = "y"'); } return $select; } }