<?php
/**
* @ASCOOS-NAME : Ascoos OS
* @ASCOOS-VERSION : 26.0.0
* @ASCOOS-SUPPORT : support@ascoos.com
* @ASCOOS-BUGS : https://issues.ascoos.com
*
* @desc <English> Demonstrates checking if a property has been modified using the isPropertyModified method.
* @desc <Greek> ??????????? ??? ?????? ?? ??? ???????? ???? ???????????? ??????????????? ?? ?????? isPropertyModified.
*
* @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> Enable property change tracking
// <Greek> ???????????? ?????????????? ??????? ?????????
$object->trackPropertyChanges(true);
// <English> Update a property
// <Greek> ????????? ?????????
$object->setProperty('name', 'UpdatedObject');
// <English> Check if property was modified
// <Greek> ??????? ?? ? ???????? ?????????????
$isModified = $object->isPropertyModified('name');
// <English> Output result
// <Greek> ???????? ?????????????
echo $isModified ? "Property 'name' was modified\n" : "Property 'name' was not modified\n"; // Outputs: Property 'name' was modified
// <English> Free resources
// <Greek> ???????????? ?????
$object->Free($object);
?>
|