PHP code example of northwoods / entity-proxy

1. Go to this page and download the library: Download northwoods/entity-proxy 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/ */

    

northwoods / entity-proxy example snippets


use Northwoods\EntityProxy\ProxyFactory;

$proxy = ProxyFactory::modify($user);

$proxy->set('email', '[email protected]');

$proxy = ProxyFactory::create(User::class);

$proxy->setArray([
    'id' => 1234,
    'username' => 'jane.doe',
    'email' => null,
]);

/** @var User */
$user = $proxy->reveal();

$username = $proxy->get('username');