PHP code example of havvg / propel-uniquekey-instancepooling-behavior

1. Go to this page and download the library: Download havvg/propel-uniquekey-instancepooling-behavior 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/ */

    

havvg / propel-uniquekey-instancepooling-behavior example snippets




$email = '[email protected]';

/*
 * This retrieves the user from the database.
 * The hydrated object will be put into the instances pool under a special key.
 */
$user = UserQuery::create()->findOneByEmail($email);

// .. more code ..

/*
 * As this user is in the instances pool of the behavior,
 * the cached object will be returned without accessing the database.
 */
$user = UserQuery::create()->findOneByEmail($email);
xml
<behavior name="unique_key_instance_pooling" />