PluginProbe
Yatra – Travel Booking & Tour Operator Software / 2.1.16
Yatra – Travel Booking & Tour Operator Software v2.1.16
3.0.15 3.0.14 3.0.14.1 3.0.14.2 3.0.12 3.0.13 3.0.11 3.0.10 3.0.9 3.0.8 3.0.7 3.0.6 3.0.5 3.0.5.1 3.0.4 3.0.3 3.0.2.9 3.0.2.7 3.0.2.8 3.0.2.6 trunk 1.0.0 2.0.0 2.0.1 2.0.10 All 83 releases
yatra / core / Data / TourData.php

TourData.php in Yatra – Travel Booking & Tour Operator Software 2.1.16, at core/Data/TourData.php

27 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Yatra\Core\Data;
4
5 use Yatra\Core\Abstracts\TourParent;
6
7 class TourData
8 {
9 /* @var \Yatra\Core\Abstracts\TourParent $tourParent */
10 public function read($tourParent)
11 {
12 $id = $tourParent->get_id();
13
14 $tourParent->set_name(get_the_title($id));
15 $tourParent->set_status(get_post_status($id));
16 $tourParent->set_type(get_post_meta($id, 'yatra_tour_meta_tour_type', true));
17 $disable_booking = get_post_meta($id, 'yatra_tour_meta_disable_booking', true);
18 $is_featured = get_post_meta($id, 'yatra_tour_meta_tour_featured', true);
19 $tourParent->set_is_featured((boolean)$is_featured);
20 $can_book = !((boolean)$disable_booking === true);
21 $tourParent->set_can_book($can_book);
22 $is_fixed_departure = get_post_meta($id, 'yatra_tour_meta_tour_fixed_departure', true);
23 $tourParent->set_is_fixed_departure((boolean)$is_fixed_departure);
24 $tourParent->set_external_url(get_post_meta($id, 'yatra_tour_meta_tour_external_url', true));
25 $tourParent->set_book_now_text(get_post_meta($id, 'yatra_tour_meta_tour_external_button_text', true));
26 }
27 }