Forums / Developer / how are eztrade_products related in the database?

how are eztrade_products related in the database?

Author Message

harry mentas

Friday 10 September 2010 10:43:14 am

Hello,

I have a client that uses ezpublish. Looking at the tables in Mysql, what tables are used to store related products?

André R.

Sunday 12 September 2010 1:30:55 am

Take a look at ezcontentobject_link, relation_type comes from constants on eZContentObject class:

const RELATION_COMMON = 1;
    const RELATION_EMBED = 2;
    const RELATION_LINK = 4;
    const RELATION_ATTRIBUTE = 8;

If you want to add relations by code you can do it like this (where $object is instance of eZContentObject):

$object->addContentObjectRelation( $newObjectID, $objectVersion, 0, eZContentObject::RELATION_EMBED );

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Michal Slocinski

Wednesday 15 September 2010 1:52:58 pm

"

Take a look at ezcontentobject_link, relation_type comes from constants on eZContentObject class:

const RELATION_COMMON = 1;
    const RELATION_EMBED = 2;
    const RELATION_LINK = 4;
    const RELATION_ATTRIBUTE = 8;

If you want to add relations by code you can do it like this (where $object is instance of eZContentObject):

$object->addContentObjectRelation( $newObjectID, $objectVersion, 0, eZContentObject::RELATION_EMBED );
"

Hi André,

I have similar problem.

I created custom class and added attribute of "Object Relations" type.

Using method similar to the one you presented:

$object->addContentObjectRelation( $newObjectID, $objectVersion, $attributeId, eZContentObject::RELATION_EMBED );

where $attributeId is ID of my attribute in that class of "Object Relations" type.

I can see that relation is being created on "Relations" tab of that object (and "Reverse Related Relation" in destination object has been also created) however in "preview" and when I hit "edit" on that object, I don't see related object(s) being selected in list of checkboxes which represent this relation (note: I chosen to represent this relation as list of checkboxes when adding Object Relations attribute to my class).

Can you give me some hints here?

regards,

Michal

Michal Slocinski

Wednesday 15 September 2010 2:33:54 pm

Hi Andre!

Just to let you know I have found solution.

Basically I used $attribute->fromString(..) method and provided parameter in format listed here: http://ezpedia.org/en/ez/simple_fromstring_and_tostring_interface_for_attributes

Calling $attribute->store() after reading values from string works perfectly now.

Michal

eZ debug

Timing: Jan 18 2025 00:58:04
Script start
Timing: Jan 18 2025 00:58:04
Module start 'content'
Timing: Jan 18 2025 00:58:05
Module end 'content'
Timing: Jan 18 2025 00:58:06
Script end

Main resources:

Total runtime1.3006 sec
Peak memory usage4,096.0000 KB
Database Queries199

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0108 588.9609180.8125
Module start 'content' 0.01081.0986 769.7734592.9141
Module end 'content' 1.10950.1911 1,362.6875337.3672
Script end 1.3005  1,700.0547 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00480.3665210.0002
Check MTime0.00160.1260210.0001
Mysql Total
Database connection0.00110.083610.0011
Mysqli_queries1.214893.40301990.0061
Looping result0.00220.17031970.0000
Template Total1.258596.820.6293
Template load0.00330.255320.0017
Template processing1.255296.507620.6276
Template load and register function0.00020.016510.0002
states
state_id_array0.00240.182110.0024
state_identifier_array0.00200.152720.0010
Override
Cache load0.00270.2061330.0001
Sytem overhead
Fetch class attribute can translate value0.00190.145140.0005
Fetch class attribute name0.00160.120250.0003
XML
Image XML parsing0.00120.096040.0003
class_abstraction
Instantiating content class attribute0.00000.000950.0000
General
dbfile0.00350.2706280.0001
String conversion0.00000.002730.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
8content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
5content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1content/datatype/view/ezxmltags/quote.tpldatatype/ezxmltext/quote.tplextension/ezwebin/design/ezwebin/override/templates/datatype/ezxmltext/quote.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 21
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs