Details
-
Improvement
-
Resolution: Obsolete
-
High
-
3.10.0, 3.9.4, 4.0.0
-
None
Description
eZContentObject::contentClassIdentifier() returns the content object's class identifier based on its numerical ID.
The class identifier is stored as a local property, but there are two issues:
- if the same transformation is requested for another object of the same class, it is fetched from the database again
- the classidentifiers_<dbname>.php cache is not used, while it has all the required data
eZContentObjectTreeNode::classIDByIdentifier() does the exact opposite and uses / handles the classidentifier cache. An easy cache, with no side effect as far as I can tell, would be to expand this method this way:
static function classIDByIdentifier( $identifier, $reverse = false )
At the end of the method, when looking for the value, this piece of code should be added before the if ( isset( $identifierHash... call:
if ( $reverse )
{
$identifierHash = array_flip( $identifierHash );
}
Then in eZContentObject::contentClassIdentifier, the DB query should be changed to a call to this method:
$classIdentifier = eZContentObjectTreeNode::classIDByIdentifier( $this->ClassID, true )
Attachments
Issue Links
- relates to
-
EZP-14065 importing classes via package does not clear classidentifiers caches
- Closed
-
EZP-15523 New objects of content classes installed by the package system have incorrect names and url aliases
- Closed
-
EZP-13157 Out-of-the-box class ID/identifier inexpensive two-way conversion for PHP and templates
- Closed