__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
<?php
declare(strict_types=1);
namespace MPBC\Data;
use MPBC\{ Bundles, Settings };
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
class Form extends Abstract_Entity {
private string $title = '';
private string $content = '';
/**
* Custom fields with price adjustments.
*
* @var array <code>[ Field name => [ ...field_args, price_adjustment ] ]</code>
*/
private array $structure = array();
/**
* @var string[] "currency", "currency_position" etc.
*/
private array $settings = array();
/**
* @var int[]
*/
private array $property_ids = array();
public function get_title(): string {
return $this->title;
}
public function set_title( string $title ): void {
$this->title = $title;
}
public function get_content(): string {
return $this->content;
}
public function set_content( string $content ): void {
$this->content = $content;
}
public function get_structure(): array {
return $this->structure;
}
public function set_structure( array $structure ): void {
$this->structure = $structure;
}
public function get_settings(): array {
return $this->settings;
}
public function set_settings( array $settings ): void {
$this->settings = $settings;
}
public function get_currency(): string {
return $this->settings['currency'] ?? '';
}
public function get_currency_symbol(): string {
if ( isset( $this->settings['currency_symbol'] ) ) {
return $this->settings['currency_symbol'];
} else {
$currency = $this->get_currency();
if ( $currency !== '' ) {
return Bundles::get_currency_symbol( $currency );
} else {
return '';
}
}
}
public function get_currency_position(): string {
return $this->settings['currency_position'] ?? '';
}
public function get_property_ids(): array {
return $this->property_ids;
}
public function set_property_ids( array $property_ids ): void {
$this->property_ids = $property_ids;
}
public function to_array(): array {
$settings = $this->get_settings();
// Add "currency_symbol" for JS
if ( ! empty( $settings ) && ! isset( $settings['currency_symbol'] ) ) {
$settings['currency_symbol'] = $this->get_currency_symbol();
}
return parent::to_array()
+ array(
'title' => $this->get_title(),
'content' => $this->get_content(),
'structure' => $this->get_structure(),
'settings' => $settings,
'property_ids' => $this->get_property_ids(),
);
}
}
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| mapper | Folder | 0750 |
|
|
| repository | Folder | 0750 |
|
|
| abstract-entity.php | File | 1.26 KB | 0640 |
|
| booking.php | File | 4.66 KB | 0640 |
|
| custom-fields-interface.php | File | 281 B | 0640 |
|
| customer.php | File | 1.01 KB | 0640 |
|
| form.php | File | 2.38 KB | 0640 |
|
| notification.php | File | 3.25 KB | 0640 |
|
| price-adjustable-interface.php | File | 309 B | 0640 |
|
| property.php | File | 2.68 KB | 0640 |
|
| reservation-group.php | File | 2.3 KB | 0640 |
|
| reservation-interface.php | File | 452 B | 0640 |
|
| reservation.php | File | 4.47 KB | 0640 |
|
| reserved-slot.php | File | 2.78 KB | 0640 |
|
| time-slot.php | File | 1.7 KB | 0640 |
|
| unit.php | File | 1.2 KB | 0640 |
|
| variation.php | File | 3.15 KB | 0640 |
|