Here is the thing. I have a table called tags, that has all the tags
that I'm going to associate with other tables in my database.
In the end I have the tables bellow for the HABTM relations:
activities_tags 112
cdocs_tags 11
clippings_tags 112
courses_tags 112
events_tags 112
informatives_tags 112
institutionals_tags 112
projects_tags 11
targets_tags 112
What I wish to have a function that recieves the id of a tag and query
the database for the first 2 results of all relations ordered by the
field created. Then I wish to group and ordered all results by field
created like if they were from the same table. So what I expect is to
have an array like bellow.
I don't know if i made myself clear but just note that the array is
ordered from 0 - 17 by the created field of each registry, and they
are not from the same table.
Thanks in advance. Hope someone can help me with this logical issue.
Array (
[0] => Array
(
[Activity] => Array
(
[id] => 4
[title] => atividade 03
[text] => atividade 03
[url_opening_photo_large] => atividades/
abertura03.jpg
[url_opening_photo_small] => eventos/
evento_lista03.png
[administrator_id] => 1
[url_content_photo] =>
[created] => 2010-11-18 15:00:21
[modified] => 2010-11-18 15:00:21
)
)
[1] => Array
(
[Cdoc] => Array
(
[id] => 7
[title] => atividade 07
[text] => atividade 07
[url_opening_photo_large] => atividades/
abertura07.jpg
[url_opening_photo_small] => eventos/
evento_lista07.png
[administrator_id] => 1
[url_content_photo] =>
[created] => 2010-11-18 14:10:21
[modified] => 2010-11-18 14:10:21
)
)
[2] => Array
(
[Informative] => Array
(
[id] => 4
[title] => atividade 03
[text] => atividade 03
[url_opening_photo_large] => atividades/
abertura03.jpg
[url_opening_photo_small] => eventos/
evento_lista03.png
[administrator_id] => 1
[url_content_photo] =>
[created] => 2010-11-17 15:00:21
[modified] => 2010-11-17 15:00:21
)
)
[3] => Array
(
[Project] => Array
(
[id] => 4
[title] => atividade 03
[text] => atividade 03
[url_opening_photo_large] => atividades/
abertura03.jpg
[url_opening_photo_small] => eventos/
evento_lista03.png
[administrator_id] => 1
[url_content_photo] =>
[created] => 2010-11-16 15:00:21
[modified] => 2010-11-16 15:00:21
)
)
[4] => Array
(
[Course] => Array
(
[id] => 4
[title] => atividade 03
[text] => atividade 03
[url_opening_photo_large] => atividades/
abertura03.jpg
[url_opening_photo_small] => eventos/
evento_lista03.png
[administrator_id] => 1
[url_content_photo] =>
[created] => 2010-11-15 15:00:21
[modified] => 2010-11-15 15:00:21
)
)
[5] => Array
(
[Target] => Array
(
[id] => 4
[title] => atividade 03
[text] => atividade 03
[url_opening_photo_large] => atividades/
abertura03.jpg
[url_opening_photo_small] => eventos/
evento_lista03.png
[administrator_id] => 1
[url_content_photo] =>
[created] => 2010-11-14 15:00:21
[modified] => 2010-11-14 15:00:21
)
)
[6] => Array
(
[Institutional] => Array
(
[id] => 4
[title] => atividade 03
[text] => atividade 03
[url_opening_photo_large] => atividades/
abertura03.jpg
[url_opening_photo_small] => eventos/
evento_lista03.png
[administrator_id] => 1
[url_content_photo] =>
[created] => 2010-11-13 15:00:21
[modified] => 2010-11-13 15:00:21
)
)
[7] => Array
(
[Clipping] => Array
(
[id] => 4
[title] => atividade 03
[text] => atividade 03
[url_opening_photo_large] => atividades/
abertura03.jpg
[url_opening_photo_small] => eventos/
evento_lista03.png
[administrator_id] => 1
[url_content_photo] =>
[created] => 2010-11-12 15:00:21
[modified] => 2010-11-12 15:00:21
)
)
[8] => Array
(
[Event] => Array
(
[id] => 4
[title] => atividade 03
[text] => atividade 03
[url_opening_photo_large] => atividades/
abertura03.jpg
[url_opening_photo_small] => eventos/
evento_lista03.png
[administrator_id] => 1
[url_content_photo] =>
[created] => 2010-11-11 15:00:21
[modified] => 2010-11-11 15:00:21
)
)
[9] => Array
(
[Clipping] => Array
(
[id] => 4
[title] => atividade 03
[text] => atividade 03
[url_opening_photo_large] => atividades/
abertura03.jpg
[url_opening_photo_small] => eventos/
evento_lista03.png
[administrator_id] => 1
[url_content_photo] =>
[created] => 2010-11-10 15:00:21
[modified] => 2010-11-10 15:00:21
)
)
[10] => Array
(
[Institutional] => Array
(
[id] => 4
[title] => atividade 03
[text] => atividade 03
[url_opening_photo_large] => atividades/
abertura03.jpg
[url_opening_photo_small] => eventos/
evento_lista03.png
[administrator_id] => 1
[url_content_photo] =>
[created] => 2010-11-09 15:00:21
[modified] => 2010-11-09 15:00:21
)
)
[11] => Array
(
[Target] => Array
(
[id] => 4
[title] => atividade 03
[text] => atividade 03
[url_opening_photo_large] => atividades/
abertura03.jpg
[url_opening_photo_small] => eventos/
evento_lista03.png
[administrator_id] => 1
[url_content_photo] =>
[created] => 2010-11-08 15:00:21
[modified] => 2010-11-08 15:00:21
)
)
[12] => Array
(
[Activity] => Array
(
[id] => 4
[title] => atividade 03
[text] => atividade 03
[url_opening_photo_large] => atividades/
abertura03.jpg
[url_opening_photo_small] => eventos/
evento_lista03.png
[administrator_id] => 1
[url_content_photo] =>
[created] => 2010-11-07 15:00:21
[modified] => 2010-11-07 15:00:21
)
)
[13] => Array
(
[Informative] => Array
(
[id] => 4
[title] => atividade 03
[text] => atividade 03
[url_opening_photo_large] => atividades/
abertura03.jpg
[url_opening_photo_small] => eventos/
evento_lista03.png
[administrator_id] => 1
[url_content_photo] =>
[created] => 2010-11-06 15:00:21
[modified] => 2010-11-06 15:00:21
)
)
[14] => Array
(
[Course] => Array
(
[id] => 4
[title] => atividade 03
[text] => atividade 03
[url_opening_photo_large] => atividades/
abertura03.jpg
[url_opening_photo_small] => eventos/
evento_lista03.png
[administrator_id] => 1
[url_content_photo] =>
[created] => 2010-11-05 15:00:21
[modified] => 2010-11-05 15:00:21
)
)
[15] => Array
(
[Event] => Array
(
[id] => 4
[title] => atividade 03
[text] => atividade 03
[url_opening_photo_large] => atividades/
abertura03.jpg
[url_opening_photo_small] => eventos/
evento_lista03.png
[administrator_id] => 1
[url_content_photo] =>
[created] => 2010-11-04 15:00:21
[modified] => 2010-11-04 15:00:21
)
)
[16] => Array
(
[Target] => Array
(
[id] => 4
[title] => atividade 03
[text] => atividade 03
[url_opening_photo_large] => atividades/
abertura03.jpg
[url_opening_photo_small] => eventos/
evento_lista03.png
[administrator_id] => 1
[url_content_photo] =>
[created] => 2010-11-03 15:00:21
[modified] => 2010-11-03 15:00:21
)
)
[17] => Array
(
[Cdoc] => Array
(
[id] => 4
[title] => atividade 03
[text] => atividade 03
[url_opening_photo_large] => atividades/
abertura03.jpg
[url_opening_photo_small] => eventos/
evento_lista03.png
[administrator_id] => 1
[url_content_photo] =>
[created] => 2010-11-02 15:00:21
[modified] => 2010-11-02 15:00:21
)
)
Check out the new CakePHP Questions site http://cakeqs.org and help others with
their CakePHP related questions.
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en