trunk: PersistentObject and relations

Author Message

G E

Thursday 23 November 2006 11:03:44 pm

Sorry for my english.
From documentation. An array ezcPersistentObjectDefinition::relations indexed by _class names_ of the related objects. Methods ezcPersistentSession::getRelatedObject( $object, $relatedClass ) and ezcPersistentSession::getRelatedObjects( $object, $relatedClass ) lookup related object by _class names_. What's about domain object has several properties with same class? For example (pseudo code):

class Person 
{
   int id;
   Person mother;
   Person father;
}

Generally, class name is not unique key for object relations (int, Person, Person). Unique key for it, is object property names (id, mother, father). Furthermore, loading related object by property name can to be straightly: ezcPersistentSession::getRelatedObjects( $object, $propertyName )

$mother = ezcPersistentSession::getRelatedObjects( $person, 'mother' ); // $person->mother;

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 19 2025 07:06:57
Script start
Timing: Jan 19 2025 07:06:57
Module start 'layout'
Timing: Jan 19 2025 07:06:57
Module start 'content'
Timing: Jan 19 2025 07:06:57
Module end 'content'
Timing: Jan 19 2025 07:06:57
Script end

Main resources:

Total runtime0.0181 sec
Peak memory usage4,096.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0065 589.1797152.6250
Module start 'layout' 0.00650.0045 741.804739.4453
Module start 'content' 0.01100.0050 781.250085.3516
Module end 'content' 0.01610.0020 866.601630.3047
Script end 0.0181  896.9063 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002614.2075140.0002
Check MTime0.00116.0206140.0001
Mysql Total
Database connection0.00084.407410.0008
Mysqli_queries0.004424.392430.0015
Looping result0.00000.094610.0000
Template Total0.00179.310.0017
Template load0.00095.069510.0009
Template processing0.00084.155210.0008
Override
Cache load0.00073.592910.0007
General
dbfile0.00021.364980.0000
String conversion0.00000.063140.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs