1. Go to this page and download the library: Download lapistano/proxy-object library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
$proxy = new \lapistano\ProxyObject\ProxyBuilder('myClass');
// generate and configure proxied object
$proxiedObject = $proxy
->setProperties(array('myMember'))
->getProxy();
// change content proxied member
$proxiedObject->myMember = 'another value';
$proxy = new \lapistano\ProxyObject\ProxyBuilder('myClass');
// generate and configure proxied object
$proxiedObject = $proxy
->disableOriginalConstructor()
->getProxy();
// change value of proxied member
$proxiedObject->myMember = 'another value';
/**
* Provides a ProxyBuilder object.
*
* @param string $classname
* @return lapistano\ProxyObject\ProxyBuilder
*/
protected function getProxyBuilder($classname) {
return new \lapistano\ProxyObject\ProxyBuilder($classname);
}
// generate and configure proxied object
$proxiedObject = $this->getProxyBuilder('myClass')
->disableOriginalConstructor()
->getProxy();
// change value of proxied member
$proxiedObject->myMember = 'another value';
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.