Uname: Linux premium294.web-hosting.com 4.18.0-553.45.1.lve.el8.x86_64 #1 SMP Wed Mar 26 12:08:09 UTC 2025 x86_64
Software: LiteSpeed
PHP version: 8.1.32 [ PHP INFO ] PHP os: Linux
Server Ip: 104.21.48.1
Your Ip: 216.73.216.223
User: mjbynoyq (1574) | Group: mjbynoyq (1570)
Safe Mode: OFF
Disable Function:
NONE

name : group.php
<?php


class Brizy_Editor_Forms_Group extends Brizy_Admin_Serializable {


	use Brizy_Editor_Forms_DynamicPropsAware;

	/**
	 * Brizy_Editor_Forms_Group constructor.
	 *
	 * @param \BrizyForms\Model\Group|null $group
	 */
	public function __construct( \BrizyForms\Model\Group $group = null ) {
		$this->data = array();
		if ( $group ) {
			$this->data = array( 'id' => $group->getId(), 'name' => $group->getName() );
		}
	}

	/**
	 * @return string
	 */
	public function serialize() {
		return serialize( $this->jsonSerialize() );
	}

	public function unserialize( $serialized ) {
		$unserialize = unserialize( $serialized );
		if ( is_array( $unserialize ) ) {
			$this->data = $unserialize;
		}

		return $this->data = [];
	}

	#[ReturnTypeWillChange]
	public function jsonSerialize() {
		return is_array( $this->data ) ? $this->data : [];
	}

	public function convertToOptionValue() {
		return $this->data;
	}

	static public function createFromSerializedData( $data ) {
		$instance = new self();

		foreach ( $data as $key => $val ) {
			$instance->set( $key, $val );
		}

		return $instance;
	}

	public static function createFromJson( $json_obj ) {

		if ( ! isset( $json_obj ) ) {
			throw new Exception( 'Bad Request', 400 );
		}

		if ( is_object( $json_obj ) ) {
			return self::createFromSerializedData( get_object_vars( $json_obj ) );
		}

		return new self();
	}

}
© 2025 XylotrechusZ