Hey Parsifal,

Proxies are always required when working with the ORM - they are
auto-generated code that is usually dumped into some kind of temporary
directory. You may want to disable auto-generation and dump them manually
though, since you use ionCube.

Marco Pivetta

http://twitter.com/Ocramius

http://ocramius.github.com/


On 3 February 2014 09:06, Parsifal <[email protected]> wrote:

>
> Thanks a lot for the great help. following your structure, I got warnings
> for proxy directory and proxy namesapce, following the Guide it seems I was
> able to fix them, as here is my current bootstrap:
>
> <?php
> // bootstrap.php
> require_once "vendor/autoload.php";
> use Doctrine\ORM\Tools\Setup;
> use Doctrine\ORM\EntityManager;
> use Doctrine\ORM\Configuration;
> $path = __DIR__;
> $path_entity = ($path."/entities");
> $path_proxy = ($path."/proxies");
> $isDevMode = false;
> // the connection configuration
> $dbParams = array(
>     'driver'   => 'pdo_mysql',
>     'host'     => 'localhost',
>     'user'     => '',
>     'password' => '',
>     'dbname'   => '',
> );
> $evm = new Doctrine\Common\EventManager;
> // Table Prefix
> $db_prefix = "phplicengine_";
> $tablePrefix = new Doctrine\ORM\DoctrineExtensions\TablePrefix($db_prefix);
> $evm->addEventListener(Doctrine\ORM\Events::loadClassMetadata,
> $tablePrefix);
> $config = new Doctrine\ORM\Configuration;
> $driverImpl = new
> Doctrine\ORM\Mapping\Driver\StaticPHPDriver($path_entity);
> $config->setMetadataDriverImpl($driverImpl);
>
> *$config->setProxyDir($path_proxy); $config->setProxyNamespace('Proxies');*
> //set connectionoptions... see documentation
> $em = EntityManager::create($dbParams, $config);
>
> $platform = $em->getConnection()->getDatabasePlatform();
> $platform->registerDoctrineTypeMapping('enum', 'string');
> $platform->registerDoctrineTypeMapping('set', 'string');
>
> Using proxy with PHP metadriver is required? or at least is recommended?
> Anyway, when I want to generate proxy files using this:
> $ php vendor/bin/doctrine orm:generate-proxies /proxies
> I get the error:
> Fatal error: Call to a member function setInheritanceType() on a
> non-object in /home2/[edited]/composer/entities/ModulesConfig.php on line 5
>
> Since I did auto-generate them from cli, the edited like:
> namespace Entities;
>
> use Doctrine\ORM\Mapping\ClassMetadata;
> class modules_config {
>
>     public static function loadMetadata(ClassMetadata $metadata) {
>
> I think I should comment:
> //$metadata->setInheritanceType(ClassMetadataInfo::INHERITANCE_TYPE_NONE);
>
> //$metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_IDENTITY);
>
> Am I correct guessing that I should remove these two lines from entity
> files to correct the proxy generation problem? using proxy is required
> and/or recommended?
>
> Thanks again a lot.
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "doctrine-user" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/doctrine-user.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"doctrine-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to