eZ Community » Forums » eZ Publish 5 Platform » EzcPersistentObject in a bundle
expandshrink

EzcPersistentObject in a bundle

EzcPersistentObject in a bundle

Thursday 07 November 2013 9:52:45 am - 3 replies

Hi,

I'm trying to create a bundle from scratch and manage everything inside. I don't want to have some part of the code inside a extension.

So after some search in this forum, i saw that we can use EzcPersistentObject or Doctrine ORM. Doctrine will activate a second connection to the database, so i prefer not using it.

I'm following Zeta component tutorial.

I've notice that if the class have a namespace (\My\Namespace\Person), the persistence definition must reside in the file : "my/namespace/person.php"

If i don't make mistake, Symfony2 use the namespace to get the file too.

I've try different case of naming without any success, how should i manage this ? (for the moment i've change the code so the definition will be find in the file person.ezp.php)

After this, we need to instantiate ezcPersistentSession. But when i'm using $this->container->get('ezpublish.connection'), i'm getting an error :

must be an instance of ezcDbHandler, instance of eZ\Publish\Core\Persistence\Legacy\EzcDbHandler given

Can you tell me how to deal with this ?

Here my code :

 $session = new ezcPersistentSession( $this->container->get('ezpublish.connection'),
                                                new ezcPersistentCacheManager( new ezcPersistentCodeManager( '../src/' ) ) );

 

If someone have some exemple using EzcPersistentObject in a bundle, i would like to have a look.

Thank's

Thursday 07 November 2013 6:54:14 pm

Hi

maybe I'm missing the point here... If you want to work with the eZ publish content repository, this cookbook is very helpful: https://confluence.ez.no/display/EZP/Public+API+Cookbook

Cheers, Donat

Friday 08 November 2013 8:27:02 am

Thank's for your answer Donat, but i don't see any chapter about persistent object in your link

 

Maybe i've should post after this thread :

http://share.ez.no/forums/ez-publish-5-platform/which-database-persistence-layer/%28language%29/eng-GB

Modified on Wednesday 13 November 2013 11:18:34 am by H H

Thursday 14 November 2013 11:01:42 am

Hi

See my answer here: http://share.ez.no/forums/ez-publ...abase-persistence-layer#comment81980

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from