<?php
/**
* @ASCOOS-NAME : Ascoos OS
* @ASCOOS-VERSION : 26.0.0
* @ASCOOS-SUPPORT : support@ascoos.com
* @ASCOOS-BUGS : https://issues.ascoos.com
*
* @desc <English> Demonstrates creation, comparison, and retrieval of a snapshot of properties.
* @desc <Greek> ??????????? ?? ??????????, ???????? ??? ???????? ???? ???????????? ?????????.
*
* @since PHP 8.2.0
*/
use ASCOOS\OS\Kernel\Core\TObject;
// <English> Initialize properties array with configuration
// <Greek> ???????????? ?????? ????????? ?? ??????????
$properties = [
'name' => 'TestObject',
'version' => 260000
];
// <English> Create a new TObject instance
// <Greek> ?????????? ???? instance ??? TObject
$object = new TObject($properties);
// <English> Create a snapshot of current properties
// <Greek> ?????????? ???????????? ??? ????????? ?????????
$object->setPropertySnapshot('initial');
// <English> Update properties
// <Greek> ????????? ?????????
$object->setProperty('name', 'UpdatedObject');
$object->setProperty('version', 260001);
// <English> Output current properties
// <Greek> ???????? ????????? ?????????
print_r($object->getProperties()); // Outputs: ['name' => 'UpdatedObject', 'version' => '260001', ...]
// <English> Output snapshot
// <Greek> ???????? ????????????
print_r($object->getPropertySnapshot('initial')); // Outputs: ['name' => 'TestObject', 'version' => 260000, ...]
// <English> Free resources
// <Greek> ???????????? ?????
$object->Free($object);
?>
|