Forums / Developer / Change class type of users?

Change class type of users?

Author Message

Marco Rogers

Monday 15 November 2010 2:10:10 pm

The users in my database are one of 2 class types. The default User or a new Visitor class that we originally created for a different feature. We have scrapped that feature and would now like to convert all Visitor Objects to User objects. What's the easiest way to do this. I would like to avoid doing a migration in PHP.

Can I change the class identifier in the database? Will that work properly or will this put the objects into an inconsistent state?

FYI, the attributes are mirrored between the two classes so as long as the attributes are still attached after the transition, I shouldn't need to mess with those. I'm only concerned about switching the class type of the user content object.

Thanks

:Marco

Heath

Monday 15 November 2010 9:34:55 pm

Hello Marco,

I seem to remember an older contribution that provide this functionality.

I found it! http://projects.ez.no/object_content_class_change

I see it has not been updated in a long time though.

It would be nice if it could be updated for use with eZ Publish 4.x/4.4

Cheers,

Heath

Brookins Consulting | http://brookinsconsulting.com/
Certified | http://auth.ez.no/certification/verify/380350
Solutions | http://projects.ez.no/users/community/brookins_consulting
eZpedia community documentation project | http://ezpedia.org

paul bolger

Wednesday 17 November 2010 10:31:37 pm

I used object_content_class_change on a site a couple of years ago and it worked really well, not sure about now. I'd definitely not use it on a live site though...

That sort of functionality really should be in the core of eZ.

Paul Bolger