PHP code example of net_bazzline / php_propel_behavior_entity_instantiator

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

    

net_bazzline / php_propel_behavior_entity_instantiator example snippets




namespace Database\Service;

use PDO;
use Propel;

/**
 * Class MyEntityInstantiator
 *
 * @author Net\Bazzline\Propel\Behavior\EntityInstantiatorNet\Bazzline\Propel\Behavior\EntityInstantiator\EntityInstantiatorGenerator
 * @since 2015-08-29
 * @see http://www.bazzline.net
 */
class MyEntityInstantiator extends MyAbstractEntityInstantiator
{
    /** 
     * @return PDO
     */
    public function getConnection($name = 'exampleDatabase', $mode = \Propel::CONNECTION_WRITE)
    {   
        return Propel::getConnection($name, $mode);
    }   

    /** 
     * @return \Database\User
     */
    public function createUser()
    {   
        return new \Database\User();
    }   

    /** 
     * @return \Database\UserQuery
     */
    public function createUserQuery()
    {   
        return new \Database\UserQuery::create();
    }   
}   

mkdir -p vendor/net_bazzline/php_propel_behavior_entity_instantiator
cd vendor/net_bazzline/php_propel_behavior_entity_instantiator
git clone https://github.com/bazzline/php_propel_behavior_entity_instantiator

"net_bazzline/php_propel_behavior_entity_instantiator": "dev-master"