This site has been archived. To learn more about our current products Ibexa Content, Ibexa Experience, Ibexa Commerce head over to the Ibexa Developer Portal

eZ Community » Forums » eZ Publish 5 Platform » Doctrine and eZUser

Doctrine and eZUser

Doctrine and eZUser

Monday 31 March 2014 11:34:34 am - 7 replies


I installed Doctrine and I used to import external data. In my tables created by Doctrine, I have a user column. I like to know if it is possible to linked this to ezUser objects? Currently I have only recovered with the remote id.



Monday 31 March 2014 11:38:21 am

Hi Johann

This is only possible as of 5.3 / 2014.01. See the new authentication documentation and the cookbook entry for using external user providers.

Monday 31 March 2014 2:25:27 pm

Hi Jérôme,

Thanks for your answer.

I'm not sure I understood everything. I want to set an attribute of my entity doctrine as such eZ User.

Can I do it directly in my annotation attribute ? ex  :

* @ORM\ManyToOne(targetEntity="eZ\Repository\UserService", inversedBy="products")
* @ORM\JoinColumn(name="user", nullable=false)    
protected $user;

Modified on Monday 31 March 2014 2:26:50 pm by Johann Roc

Monday 31 March 2014 2:37:46 pm


No, I had the EntityUserProvider in mind, or FOSUserBundle if you prefer. No need to do a relation. However you'll need to match a valid eZ User as described in the cookbook recipe for external user providers.

Monday 31 March 2014 3:05:29 pm

In fact, i don't have external providers. My users are already in eZ Publish.

If  i can't link to ezuser I have to edit my doctrine queries and map user directly in the controller (where user = currentuserid) ?

Monday 31 March 2014 3:20:49 pm

If you don't have external providers, then why do you want to use an external entity ? happy.gif Emoticon

To retrieve a user, just use the UserService then blunk.gif Emoticon

Wednesday 02 April 2014 3:00:42 pm

Thank you. I know the basis on Symfony and eZ Publish. But I have great difficulty in associating the two logics. It should be also I forget the logic eZ Publish.

Thursday 03 April 2014 11:25:36 am

The Repository really is the aspect you should care about. If you haven't read it yet, the Public API basics doc page could maybe help you get into it.

It (the repo) should be considered as a pure repository: it gives you access to the content domain we provide (Content, made out of Fields, exposed through Locations, etc). Pretty much everything else (configuration, views, etc) is based on Symfony2 concepts.

Does it explain it a bit ? We can also have a chat in french, if it helps blunk.gif Emoticon


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

36 542 Users on board!

Forums menu

Proudly Developed with from