This site has been archived and you can no longer log in or post new messages. For up-to-date community resources please visit ezplatform.com

eZ Community » Forums » Developer » Modifier of an object
expandshrink

Modifier of an object

Modifier of an object

Wednesday 22 October 2014 5:03:55 pm - 3 replies

Hello,

In PHP I'm looking a way to found the modifier of my object.

I've got the owner wil the code :

$l_OBJ_LocalObject    = eZContentObject::fetchByRemoteID($l_STR_RemoteID);
$l_OBJ_LocalOwner    = $l_OBJ_LocalObject->owner()

But how can I have the modifier ?

Wednesday 22 October 2014 6:32:35 pm

Hello Peretjatko,

I think this would work:

$contentObjectModifier = $contentObject->attribute('current')->attribute('creator');

Re: https://doc.ez.no/eZ-Publish/Technical-manual/4.x/Reference/Objects/ezcontentobjectversion

https://doc.ez.no/eZ-Publish/Technical-manual/4.x/Reference/Objects/ezcontentobject

I hope this helps!

Cheers,
Heath 

Thursday 23 October 2014 7:11:37 pm

I've just add a fetch to your code and that's great ! 

$l_OBJ_LocalObject    = eZContentObject::fetchByRemoteID($l_STR_RemoteID);
$l_OBJ_ContentObjectModifier    = $l_OBJ_LocalObject->attribute('current')->attribute('creator');
$l_OBJ_LocalModifier                = eZUser::fetch($l_OBJ_ContentObjectModifier->ID);

Thanks a lot.

EDIT : Not so eazy to copy/paste code sample in EZ-Publish edithor indeed... :-S

Modified on Thursday 23 October 2014 7:13:32 pm by Peretjatko Alexandre

Friday 24 October 2014 3:17:49 am

Hello Peretjatko,

Yes indeed, it is more difficult to add code snippets into forum messages than it should be! I hope one day they make it easier to do this natively (to avoid the encoding from paste problems).

Alternatively you could just embed a Gist from GitHub which is way easier to do and looks better as well.

I'm glad you solved your problem and that I could help.

Cheers,
Heath 

expandshrink

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

36 542 Users on board!

Forums menu

Proudly Developed with from