__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
<?php
/**
* @package DPCalendar
* @copyright Copyright (C) 2018 Digital Peak GmbH. <https://www.digital-peak.com>
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU/GPL
*/
namespace DigitalPeak\Component\DPCalendar\Administrator\Booking\Stages;
defined('_JEXEC') or die();
use DigitalPeak\Component\DPCalendar\Administrator\Model\CountryModel;
use DigitalPeak\Component\DPCalendar\Administrator\Model\GeoModel;
use Joomla\Utilities\ArrayHelper;
use League\Pipeline\StageInterface;
class FetchLocationData implements StageInterface
{
public function __construct(private readonly CountryModel $model, private readonly GeoModel $geoModel)
{
}
public function __invoke($payload)
{
// Convert the country id to string
$locationData = ArrayHelper::toObject($payload->data);
if (!empty($locationData->country)) {
$country = $this->model->getItem($locationData->country);
$locationData->country = $country ? $country->short_code : '';
}
// Fetch the latitude/longitude
$location = $this->geoModel->format([$locationData]);
if ($location && empty($payload->data['latitude'])) {
$payload->data['latitude'] = null;
$payload->data['longitude'] = null;
$location = $this->geoModel->getLocation($location, false);
if ($location->latitude) {
$payload->data['latitude'] = $location->latitude;
$payload->data['longitude'] = $location->longitude;
}
}
return $payload;
}
}
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| AdjustCustomFields.php | File | 1023 B | 0664 |
|
| AssignUserGroups.php | File | 1.15 KB | 0664 |
|
| CollectEventsAndTickets.php | File | 2.68 KB | 0664 |
|
| CreateOrUpdateTickets.php | File | 3.7 KB | 0664 |
|
| CreateUser.php | File | 2.13 KB | 0664 |
|
| FetchLocationData.php | File | 1.41 KB | 0664 |
|
| SendInviteMail.php | File | 2.45 KB | 0664 |
|
| SendNewBookingMail.php | File | 4.67 KB | 0664 |
|
| SendNotificationMail.php | File | 3.33 KB | 0664 |
|
| SendPaidBookingMail.php | File | 3.31 KB | 0664 |
|
| SendWaitingListMail.php | File | 3.03 KB | 0664 |
|
| SetupForMail.php | File | 3.17 KB | 0664 |
|
| SetupForNew.php | File | 11.61 KB | 0664 |
|
| SetupForUpdate.php | File | 1.82 KB | 0664 |
|
| SetupLanguage.php | File | 1.45 KB | 0664 |
|