Re: HABTM questions

2009-12-03 Thread Martin Westin
About the pagination: http://book.cakephp.org/view/83/hasAndBelongsToMany-HABTM Look at the bottom. The last examples abut binding can be used to let paginator deal with your habtm. When it comes to finding related data find is better than read. But probably find('first') in this case since it

Re: HABTM questions

2009-12-03 Thread jodator
From something,I'm currently working on (I've changed my Models to yours, but only names) //paginator variable: $this-paginate = array('Asset' = array( 'limit' = 10, 'order' = array('Asset.promoted DESC', 'Asset.name ASC'), 'conditions' = array(

HABTM questions

2009-12-02 Thread Alan Asher
I've been scouring the web for a while trying to figure this out. My brain is fried, so I need some help. I have a model called Containers, a model called Assets and HABTM table called AssetsContainer. So a container can have many assets. The first question I have is when I'm doing

Re: More HABTM questions - querying data

2009-07-08 Thread Alastair
and not pull all the un-necessary info. Dave -Original Message- From: Alastair [mailto:m...@alastairmoore.com] Sent: July-07-09 10:31 PM To: CakePHP Subject: More HABTM questions - querying data Robert P kindly solved a problem I was having with updating records

Re: More HABTM questions - querying data

2009-07-08 Thread Robert P
from related models and not pull all the un-necessary info. Dave -Original Message- From: Alastair [mailto:m...@alastairmoore.com] Sent: July-07-09 10:31 PM To: CakePHP Subject: More HABTM questions - querying data Robert P kindly solved a problem I

Re: More HABTM questions - querying data

2009-07-08 Thread Robert P
HABTM questions - querying data Robert P kindly solved a problem I was having with updating records in a HABTM relationship so many thanks to him for that! I'm now trying to query the data but have added an additional model to my system, Regions. So it looks

Re: More HABTM questions - querying data

2009-07-08 Thread Alastair
On Jul 8, 12:43 pm, Robert P shiftyrobs...@gmail.com wrote: Refactored to remove unnecessary table. $joins = array(         array(                 'table' = 'counties_users',                 'alias' = 'CountiesUsers',                 'type' = 'INNER',                 'conditions' =

More HABTM questions - querying data

2009-07-07 Thread Alastair
Robert P kindly solved a problem I was having with updating records in a HABTM relationship so many thanks to him for that! I'm now trying to query the data but have added an additional model to my system, Regions. So it looks something like: Members HasAndBelongsToMany County County BelongsTo

RE: More HABTM questions - querying data

2009-07-07 Thread Dave Maharaj :: WidePixels.com
Use contain There is a chapter in the cookbook how to get only the records from related models and not pull all the un-necessary info. Dave -Original Message- From: Alastair [mailto:m...@alastairmoore.com] Sent: July-07-09 10:31 PM To: CakePHP Subject: More HABTM questions

Re: More HABTM questions - querying data

2009-07-07 Thread Robert P
- From: Alastair [mailto:m...@alastairmoore.com] Sent: July-07-09 10:31 PM To: CakePHP Subject: More HABTM questions - querying data Robert P kindly solved a problem I was having with updating records in a HABTM relationship so many thanks to him for that! I'm now trying to query the data

More HABTM questions

2008-11-10 Thread Jason
Sorry to beat what is certainly a very uncomfortable horse... The db is as follows Users HABTM Groups HABTM Reports (using Group_Users and Group_Reports tables to manage relationships) I want to have conditions on both users and reports while returning a particular report only once. Basically