$apiKey, ':user_url' => \Utils\Variables::getSiteWithProtocol() . '/id/', ]; $query = ( 'SELECT -- create user url :user_url || event_account.id AS internal_url, -- -event_account.id, event_account.userid, event_account.created, -- event_account.key, event_account.lastip, event_account.lastemail, event_account.lastphone, event_account.lastseen, event_account.fullname, event_account.firstname, event_account.lastname, -- event_account.is_important, event_account.total_visit, event_account.total_country, event_account.total_ip, event_account.total_device, event_account.total_shared_ip, event_account.total_shared_phone, event_account.score_updated_at, event_account.score, event_account.score_details, event_account.reviewed, event_account.fraud, event_account.latest_decision FROM event_account' ); $where = ' WHERE key = :api_key'; if ($userId !== null) { $params[':user_id'] = $userId; $where .= ' AND event_account.id = :user_id'; } $query .= $where; return $this->execQuery($query, $params); } }