??????????????
??????????????
??????????????
??????????????
Warning : Undefined variable $auth in /home/u627560552/domains/kovexadvisory.com/public_html/666.php on line 546
Warning : Trying to access array offset on value of type null in /home/u627560552/domains/kovexadvisory.com/public_html/666.php on line 546
??????????????
??????????????
??????????????
??????????????
File Manager
✏️ Edit File: /home/mklsvubc/netecfwd.co.uk/wp-content/plugins/latepoint/lib/models/off_period_model.php
⬅ Kembali
<?php
class OsOffPeriodModel extends OsModel {
var $id,
$summary,
$start_date,
$end_date,
$start_time,
$end_time,
$start_datetime_utc,
$end_datetime_utc,
$service_id,
$agent_id,
$location_id,
$server_timezone,
$created_at,
$updated_at;
function __construct( $id = false ) {
parent::__construct();
$this->table_name = LATEPOINT_TABLE_BLOCKED_PERIODS;
$this->nice_names = array();
if ( $id ) {
$this->load_by_id( $id );
}
}
public function set_utc_datetimes( bool $save = false ) {
if ( empty( $this->start_date ) || empty( $this->end_date ) || empty( $this->start_time ) || empty( $this->end_time ) ) {
return;
}
$this->start_datetime_utc = $this->get_start_datetime( 'UTC' )->format( LATEPOINT_DATETIME_DB_FORMAT );
$this->end_datetime_utc = $this->get_end_datetime( 'UTC' )->format( LATEPOINT_DATETIME_DB_FORMAT );
if ( $save ) {
$this->update_attributes(
[
'start_datetime_utc' => $this->start_datetime_utc,
'end_datetime_utc' => $this->end_datetime_utc,
]
);
}
}
protected function before_save() {
$this->set_utc_datetimes();
$this->server_timezone = OsTimeHelper::get_wp_timezone();
}
public function get_start_datetime( string $set_timezone = 'UTC' ): OsWpDateTime {
try {
// start_time and start_date is legacy stored in wordpress timezone
$dateTime = new OsWpDateTime( $this->start_date . ' 00:00:00', OsTimeHelper::get_wp_timezone() );
if ( $this->start_time > 0 ) {
$dateTime->modify( '+' . $this->start_time . ' minutes' );
}
if ( $set_timezone ) {
$dateTime->setTimezone( new DateTimeZone( $set_timezone ) );
}
return $dateTime;
} catch ( Exception $e ) {
return new OsWpDateTime( 'now' );
}
}
public function get_end_datetime( string $set_timezone = 'UTC' ): OsWpDateTime {
try {
// start_time and start_date is legacy stored in wordpress timezone
$dateTime = new OsWpDateTime( $this->end_date . ' 00:00:00', OsTimeHelper::get_wp_timezone() );
if ( $this->end_time > 0 ) {
$dateTime->modify( '+' . $this->end_time . ' minutes' );
}
if ( $set_timezone ) {
$dateTime->setTimezone( new DateTimeZone( $set_timezone ) );
}
return $dateTime;
} catch ( Exception $e ) {
return new OsWpDateTime( 'now' );
}
}
protected function allowed_params( $role = 'admin' ) {
$allowed_params = array(
'id',
'summary',
'start_date',
'end_date',
'start_time',
'end_time',
'start_datetime_utc',
'end_datetime_utc',
'service_id',
'agent_id',
'location_id',
'server_timezone',
'created_at',
'updated_at',
);
return $allowed_params;
}
protected function params_to_save( $role = 'admin' ) {
$params_to_save = array(
'id',
'summary',
'start_date',
'end_date',
'start_time',
'end_time',
'start_datetime_utc',
'end_datetime_utc',
'service_id',
'agent_id',
'location_id',
'server_timezone',
'created_at',
'updated_at',
);
return $params_to_save;
}
protected function properties_to_validate() {
$validations = array(
'start_date' => array( 'presence' ),
'end_date' => array( 'presence' ),
);
return $validations;
}
}
Nama
Tipe
Ukuran
Diubah
Aksi
🐘 activity_model.php
php
5.1 KB
2026-03-10 11:15
🐘 agent_meta_model.php
php
190 B
2026-03-10 11:15
🐘 agent_model.php
php
13.5 KB
2026-03-19 14:44
🐘 booking_meta_model.php
php
194 B
2026-03-10 11:15
🐘 booking_model.php
php
43.7 KB
2026-06-24 10:07
🐘 bundle_meta_model.php
php
192 B
2026-03-10 11:15
🐘 bundle_model.php
php
8.9 KB
2026-06-24 10:07
🐘 cart_item_model.php
php
8.4 KB
2026-03-10 11:15
🐘 cart_meta_model.php
php
253 B
2026-03-10 11:15
🐘 cart_model.php
php
16.8 KB
2026-06-15 12:21
🐘 connector_model.php
php
1.1 KB
2026-03-10 11:15
🐘 customer_meta_model.php
php
196 B
2026-03-10 11:15
🐘 customer_model.php
php
15.6 KB
2026-05-14 14:27
🐘 invoice_model.php
php
6 KB
2026-06-15 12:21
🐘 join_bundles_services_model.php
php
1 KB
2026-03-10 11:15
🐘 location_category_model.php
php
4.4 KB
2026-03-10 11:15
🐘 location_model.php
php
6.2 KB
2026-03-10 11:15
🐘 meta_model.php
php
3.8 KB
2026-03-10 11:15
🐘 model.php
php
32.2 KB
2026-03-10 11:15
🐘 off_period_model.php
php
3.1 KB
2026-03-10 11:15
🐘 order_intent_meta_model.php
php
268 B
2026-03-10 11:15
🐘 order_intent_model.php
php
18.8 KB
2026-06-24 10:07
🐘 order_item_model.php
php
8.4 KB
2026-03-10 11:15
🐘 order_meta_model.php
php
255 B
2026-03-10 11:15
🐘 order_model.php
php
18 KB
2026-05-29 11:28
🐘 otp_model.php
php
1.1 KB
2026-03-10 11:15
🐘 payment_request_model.php
php
2.5 KB
2026-03-10 11:15
🐘 process_job_model.php
php
10.3 KB
2026-03-10 11:15
🐘 process_model.php
php
7.8 KB
2026-05-29 11:28
🐘 recurrence_model.php
php
793 B
2026-03-10 11:15
🐘 service_category_model.php
php
3.8 KB
2026-03-10 11:15
🐘 service_meta_model.php
php
194 B
2026-03-10 11:15
🐘 service_model.php
php
18.6 KB
2026-03-10 11:15
🐘 session_model.php
php
898 B
2026-03-10 11:15
🐘 settings_model.php
php
973 B
2026-03-10 11:15
🐘 step_settings_model.php
php
1.1 KB
2026-03-10 11:15
🐘 transaction_intent_model.php
php
11 KB
2026-03-10 11:15
🐘 transaction_model.php
php
6 KB
2026-03-10 11:15
🐘 transaction_refund_model.php
php
1.5 KB
2026-03-10 11:15
🐘 work_period_model.php
php
1.6 KB
2026-03-10 11:15