fetch - sort by date created

Author Message

Marko Žmak

Friday 21 July 2006 11:47:20 am

I know it is possible to sort nodes in a fetch operator function but is it possible to sort them by the date they were initially created?

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Matthew Carroll

Friday 21 July 2006 11:54:22 am

Is 'sort_by', 'published' not what you want?

http://ez.no/doc/ez_publish/technical_manual/3_8/reference/modules/content/fetch_functions/list

Matthew

http://carroll.org.uk

Marko Žmak

Saturday 22 July 2006 10:12:42 am

No, I don't want to sort them by "published date" but by "creation date". Sorting by "published" sorts nodes based on creation date of the last published version. But I wan't to sort them by the creation date of the object, that is the creation date of the first version that was created. Is this possible somehow?

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Kristof Coomans

Tuesday 25 July 2006 10:47:05 am

I doubt the documentation is right about that.

The published date only is initialized when the object gets published for the first time (it's still 0). The modified time is changed every time a new version is published.

See kernel/content/ezcontentoperationcollection.php function setObjectStatusPublished, starting from line 184 on trunk rev. 16527

if ( $object->attribute( 'published' ) == 0 )
{
    $object->setAttribute( 'published', mktime() );
}
$object->setAttribute( 'modified', mktime() );

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Marko Žmak

Tuesday 25 July 2006 11:14:57 pm

Yes Kristof, you're right I just verified it on my site. I think the documentation should be changed in order not to confuse people.

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

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 21 2025 04:15:01
Script start
Timing: Jan 21 2025 04:15:01
Module start 'layout'
Timing: Jan 21 2025 04:15:01
Module start 'content'
Timing: Jan 21 2025 04:15:01
Module end 'content'
Timing: Jan 21 2025 04:15:01
Script end

Main resources:

Total runtime0.0177 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.0067 587.9141151.2109
Module start 'layout' 0.00670.0032 739.125036.6484
Module start 'content' 0.00990.0059 775.773494.1719
Module end 'content' 0.01590.0018 869.945337.9922
Script end 0.0177  907.9375 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002614.4256140.0002
Check MTime0.00126.7232140.0001
Mysql Total
Database connection0.00084.518810.0008
Mysqli_queries0.003117.640130.0010
Looping result0.00000.146410.0000
Template Total0.00105.710.0010
Template load0.00074.180310.0007
Template processing0.00031.515210.0003
Override
Cache load0.00052.653010.0005
General
dbfile0.00158.202180.0002
String conversion0.00000.056440.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