/** * @param $reservationId * @return array|bool */ private function getFraudCombinationAndData($reservationId) { $bookingDao = new BookingDao($this->getServiceLocator(), '\\ArrayObject'); $reservation = $bookingDao->fetchOne(function (Select $select) use($reservationId) { $select->columns(['guest_email', 'guest_first_name', 'guest_last_name', 'guest_phone', 'guest_address', 'guest_city_name', 'guest_zip_code', 'guest_country_id', 'res_number'])->join(['customer_identity' => DbTables::TBL_CUSTOMER_IDENTITY], DbTables::TBL_BOOKINGS . '.id = customer_identity.reservation_id', ['ip_address'], Select::JOIN_LEFT); $select->where->equalTo(DbTables::TBL_BOOKINGS . '.id', $reservationId); }); if (!$reservation) { return false; } $phone = $reservation['guest_phone'] ? $this->removeSymbols($reservation['guest_phone']) : ''; $fullName = $this->removeSymbols($reservation['guest_first_name'] . $reservation['guest_last_name']); $fullNamePhone = $this->removeSymbols($reservation['guest_first_name'] . $reservation['guest_last_name'] . $reservation['guest_phone']); $fullNameAddress = $this->removeSymbols($reservation['guest_first_name'] . $reservation['guest_last_name'] . $reservation['guest_address'] . $reservation['guest_city_name'] . $reservation['guest_zip_code'] . $reservation['guest_country_id']); return ['guest_email' => $this->removeSymbols($reservation['guest_email']), 'phone' => $phone, 'fullName' => $fullName, 'fullNamePhone' => $fullNamePhone, 'fullNameAddress' => $fullNameAddress, 'reservation' => $reservation]; }