set priority value

Author Message

Michele Franceschi

Saturday 24 January 2004 12:18:18 pm

I have to build a script that create content object with particular priority value.
When and Where can I set priority value ????
What php class does it (eZNodeAssignment or eZContentObjectTreeNode or ...)?

Eirik Alfstad Johansen

Sunday 25 January 2004 11:14:38 pm

Hi Michele,

I'm not sure, but I think it's the 'sort_field' parameter of the eZNodeAssignment::create method which controls this.

Sincerely,

Eirik Johansen

Sincerely,

Eirik Alfstad Johansen
http://www.netmaking.no/

Michele Franceschi

Sunday 25 January 2004 11:54:32 pm

Hi Eirik,
I use 'sort_field' parameter to select "Sort by" (Name, Published, Modified, Section, etc...)

Eirik Alfstad Johansen

Monday 26 January 2004 12:08:17 am

Hi Michele,

Then it's probably the 'sort_order' parameter.

Sincerely,

Eirik Johansen

Sincerely,

Eirik Alfstad Johansen
http://www.netmaking.no/

Michele Franceschi

Monday 26 January 2004 12:44:42 am

I use 'sort_order' parameter to select ascending o descending

Eirik Alfstad Johansen

Monday 26 January 2004 1:05:50 am

Hi Michele,

Then I guess my first answer was better: I'm not sure. :)

It might be just as easy to access the db and set the priority directly (unless you get a better suggestion, that is).

Sincerely,

Eirik Johansen

Sincerely,

Eirik Alfstad Johansen
http://www.netmaking.no/

Eirik Alfstad Johansen

Monday 26 January 2004 1:09:37 am

Hi again,

I just took a look at the kernel code for updating priorities, and noticed that they are in fact set directly (no designated class method). Here's how it's done:

$db->query( "UPDATE ezcontentobject_tree SET priority=$priority WHERE node_id=$nodeID" );

Sincerely,

Eirik Johansen

Sincerely,

Eirik Alfstad Johansen
http://www.netmaking.no/

Michele Franceschi

Monday 26 January 2004 9:42:14 am

Thanks Eirik,
I followed your tip

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 18 2025 19:40:23
Script start
Timing: Jan 18 2025 19:40:23
Module start 'layout'
Timing: Jan 18 2025 19:40:23
Module start 'content'
Timing: Jan 18 2025 19:40:23
Module end 'content'
Timing: Jan 18 2025 19:40:23
Script end

Main resources:

Total runtime0.0183 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0069 588.9297152.6094
Module start 'layout' 0.00690.0037 741.539139.4297
Module start 'content' 0.01060.0055 780.968897.3047
Module end 'content' 0.01610.0022 878.273438.3047
Script end 0.0182  916.5781 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002915.9115140.0002
Check MTime0.00116.1961140.0001
Mysql Total
Database connection0.00136.868910.0013
Mysqli_queries0.003518.992630.0012
Looping result0.00000.103010.0000
Template Total0.00179.110.0017
Template load0.00094.785310.0009
Template processing0.00084.282010.0008
Override
Cache load0.00063.199810.0006
General
dbfile0.00031.631280.0000
String conversion0.00000.035240.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