Forums / Developer / Inexpensive class identifier and ID convertion
Piotrek Karaś
Friday 06 June 2008 12:39:30 pm
Hello there,
Is there an inexpensive method of converting class IDs to identifiers and identifiers to IDs?There seems to be something in the cache dir, that looks like this:
<?php $identifier_hash = array( "folder" => "1", "user_group" => "3", "user" => "4", "image" => "5", "link" => "11", "file" => "12", "comment" => "13", "common_ini_settings" => "14", "template_look" => "15" ... ); ?>
And the only converting method using this is eZContentObjectTreeNode::classIDByIdentifier()... Couldn't spot the opposite...
Shouldn't this be held somewhere in the session, so that conversion for any purposes doesn't require file system or db access?
-- Company: mediaSELF Sp. z o.o., http://www.mediaself.pl eZ references: http://ez.no/partners/worldwide_partners/mediaself eZ certified developer: http://ez.no/certification/verify/272585 eZ blog: http://ez.ryba.eu
Kristof Coomans
Saturday 07 June 2008 9:36:26 pm
Hi Piotrek
The way of accessing data from this cache will be more streamlined in 4.1. See http://issues.ez.no/13068 and related commits in svn.
It might be a good idea to have this in the session, yes, although I guess the performance gain will be only small. Can you post an enhancement request for it in the issue tracker please?
independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org
Saturday 07 June 2008 10:25:25 pm
Hi Kristof,
I've just added an enhancement request:http://issues.ez.no/IssueView.php?Id=13157&
As far as performance gain, you might be right, but think of a situation, where I need that for ten independent extensions, because each one makes use of such conversion. It would be much better to have a uniform tool for that to rely on.
Thanks,Piotrek