I have the following relationships
Contact HABTM List
list HABTM Contact
Only I had to take my auto_increment primaryKey ID field from the contact
table, I'm having problem when using INSERT IGNORE.
To replace the auto_incremente created the following trigger:
DECLARE AUTOI int UNSIGNED
May i get some examples on create a drop down list with belongsTo
relationship? the option that will be show in the drop down list should be
retrieve from database table. I hardly can't find any examples on this in
the internet. please help.
thanks in advance.
--
Like Us on FaceBook
For example's sake, lets say that you have User and then UserType, user
types consists of the following records:
Admin, Editor, Contributor, User
You want to have a drop down list with all the user types, so when creating
a new user you can select which type it should be (in this example), you
The short answer is Yes as CakePHP supports nearly whatever relationships
you design in your database.
You relationships are as this:
Table1 - hasMany - Table2 - hasMany - Table3
With CakePHP you can find data from Table1 alone, from Table1 including
Table2, and also from Table1 including
Correction to this part:
Suggest you to take a look at the Model and the ModelHelper Contains in
the CakePHP book/documentation.
Should be:
Suggest you to take a look at the Model and the Behaviour Containable in
the CakePHP book/documentation.
Enjoy, John
--
Like Us on FaceBook
Dear CakePHP experts,
While designing a database structure, I created 3 tables. There is a
1-to-many relationship between the first table and second table. There is
another 1-to-many relationship between the second table and third table.
Does CakePHP allow this kind of table relationship? I
class FirstModel extends AppModel
{
public $hasOne = array('Second');
public $hasMany = array('Third');
}
class SecondModel extend AppModel
{
public $belongsTo = array('First');
}
class ThirdModel extend AppModel
{
public $belongsTo = array('First');
}
On Fri, Sep 6, 2013 at 10:13 AM,
It's a song and lyrics database. I'm trying to bake an app from my
database, which looks like this: (every table does have a primary key 'id',
I just left them out..)
songs
song_name
artists
artist_name
songs_singers
artist_id (FOREIGN KEY artists.id)
On Wed, Jan 2, 2013 at 8:32 PM, Stefano Campanella
leona...@guildofmessengers.com wrote:
Yes I am sure. In my case id is not numeric, the permission name is already
an identifier for the permission
Your DB schema is broken by design, then. Good luck with that.
--
Like Us on FaceBook
Broken for CakePHP or broken in general?
Generally, I would not see a problem in using a non-numeric primary key,
you just have to be conscious of the constraints this imposes.
If it is for a constraint of CakePHP, well I didn't experience any problem
with that yet. There is no error in
Yes I did, but it does not suit my needs or my organization structure. For
me it's at the same time too complicated and too limited. I don't need a
tree, I need a graph, where a user can have more than one group; because
users can be categorized in more than one way.
Anyway, do you have any
When running a find('count') the contain param is useless. This is
because the main query is fetching a sum, not a set of records from
which to fetch the associated 'contain' records.
Are you using AuthComponent? You can use that to fetch the User and
associated records. However, I can't remember
mmh, ok. But the problem is that even if I change the find(count) into a
find(all) it still loads data only from Group table.
Yes I am using the AuthComponent for logged in users. But since I want to
use my Authorize class also for managing what anonymous users can access I
am calling
This simply is solvable with:
$this-Auth-userScope = array('User.can_access_admin' = 1);
Put that in you beforeFilter function inside AppController, and your
problems are solved. If you want to redirect them, than you shoukd do
something like this:
if ($this-Auth-user()) {
Excuse me Ivan,
but there is no reference to userScope attribute anywhere in the source
code of cakePHP, I assume you mean $this-Auth-scope.
But it still doesn't help me, is was under the impression that that
attribute is used to impose conditions for logging users in, this is not
my case, I
I think that should be something like:
$data = $this-controller()-Group-find(
'count',
array(
'conditions' = array(
'Group.id' = 1 // hard-coded for testing?
),
'joins' = array(
array(
I just realised that this also makes no sense. Why are you running a
COUNT(*) on Group when your condition is to select only the Group with
id = 1?
Perhaps you need to start from the beginning and explain what it is
you're looking for.
And I'll second the suggestion to use ACL.
On Wed, Jan 2,
Works like a charm! Thank you so much cricket!
Now to reply to your questions:
I am using a count because I don't need any content returned. With this
query I just check if the record exists, if it does then I know the Group
has the specified permission. The count will always return 0 if group 1
array('*id*'='can_access_admin')
Do you have sure is ID? Usually ID is numeric.
Em terça-feira, 1 de janeiro de 2013 19h23min58s UTC-3, Stefano Campanella
escreveu:
Hello all,
this is my first time posting here. I recently started to study how to use
CakePHP and I'm trying to develop
Yes I am sure. In my case id is not numeric, the permission name is already
an identifier for the permission
On Wednesday, January 2, 2013 3:56:41 PM UTC+1, Maicon Pinto wrote:
array('*id*'='can_access_admin')
Do you have sure is ID? Usually ID is numeric.
Em terça-feira, 1 de
Hello all,
this is my first time posting here. I recently started to study how to use
CakePHP and I'm trying to develop a website.
In my website I am writing a custom authorize component where each user get
one or more groups and each group has one or more permissions associated to
it.
I have
Have you looked at the inbuilt Auth and ACL components? Might save you a lot of
time.
Jeremy Burns
Class Outfit
http://www.classoutfit.com
On 1 Jan 2013, at 22:23:58, Stefano Campanella leona...@guildofmessengers.com
wrote:
Hello all,
this is my first time posting here. I recently started
I have three models: Category, Post, Attachment
My Relations in these Models are:
1. Category hasMany Post hasMany Attachment
2. Post hasMany Attachment
3. Category hasMany Attachment
My attachments table has the following fields: id, title, foreign_key, model
The field model contains Category
On Tue, Nov 13, 2012 at 10:43 AM, Tsampika bettina.oberrau...@gmail.com wrote:
I have three models: Category, Post, Attachment
My Relations in these Models are:
1. Category hasMany Post hasMany Attachment
2. Post hasMany Attachment
3. Category hasMany Attachment
My attachments table has
Hi everybody,
After days of trial-and-error and almost giving up, I've managed to get
some basic and – as I believe – very common scenarios solved in CakePHP. I
was wondering, why the documentation is not clear on these aspects, so I
described my findings in a somewhat lengthy blog post.
You
this but it didn't get updated and
no longer works.
What is the best way in CakePHP to add additional related objects (not new
relationships!) when some already exist? Am I supposed to just manually *
save()* records to the join table using the implicit join table model?
4. Question:
Last but not least
Hello Again Everyone-
I'm having a bit of trouble establishing my databases. To sum up my
application, it allows users to make modules which then can be viewed by
other users of the creator's choice.
So I have:
User hasMany Module -- This is where I place the user id number of the
creator
you can very well implement HABTM for users--modules relationship simplly
including the owner as a user.
Further in the controller or view,give condition for only owner to be able
to edit. Or u can give a column as user_id in the module table, to track
the owner of the modules, but if u go for
relationships and resaves them. That's the only way it knows
not to get duplicates, or that you removed them. The HABTM behavior helps
you save/delete single ones without needing to know the others, i.e.,
saving/removing one follower without knowledge of the other followers.
Your follow button should go
your relations are in the controller - they should be in the model
you don't need to loadModel follower as User hasMany followers
- S
On 22 January 2012 16:20, J. contact.mysparet...@gmail.com wrote:
I'm making a follower system ala Twitter.
Here is my UsersController :
class
I'm making a follower system ala Twitter.
Here is my UsersController :
class UsersController extends AppController {
public $name = 'Users';
public $helpers = array('Html', 'Form', 'Paginator');
var $hasAndBelongsToMany = array(
'Followed' = array(
'className' = 'User',
I just learned something and thought I would share.
So I came across the need to apply a condition to a hasMany query. I was
like how in the world do I do that?
// Get all Checkpoints with Appropriate Spec
$this-VehicleDailyLog-VehicleDailyLogCheckpoint-VehicleCheckpoint
If I have a long list of ids(extracted from a table), and I have to pull out
corresponding records from another table, can it be done via
an iteration loop and stored in a *single* variable(so that it can be easily
passed on to the view)? Or do I have to use Relationships?
--
Our newest site
corresponding records from another table, can it be done via an iteration
loop and stored in a single variable(so that it can be easily passed on to
the view)? Or do I have to use Relationships?
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out
Hi,
I'm curious as to how models which use different datasources handle
relationships?
If i was to create a datasource to consume a web service, and I wanted it to
pick up related fields via a HasOne relationship to a model using a mysql
database table, will cake just automagically resolve
On Tue, Feb 22, 2011 at 7:56 AM, Greg Skerman gsker...@gmail.com wrote:
Hi,
I'm curious as to how models which use different datasources handle
relationships?
If i was to create a datasource to consume a web service, and I wanted it to
pick up related fields via a HasOne relationship
You could consider adding a new column to your joining table that contains a
tinyint. By default the value of that field is 0 (which indicates wants) but
changes to 1 when he owns it. This assumes that someone can no longer 'want'
something when they already 'own' it.
Jeremy Burns
Class Outfit
Thanks for replies... I added a two boolean columns to join table for
owns and wants
Thanks again!!
On Jan 13, 3:13 am, Jeremy Burns | Class Outfit
jeremybu...@classoutfit.com wrote:
You could consider adding a new column to your joining table that contains a
tinyint. By default the value of
On Thu, Jan 13, 2011 at 3:55 PM, mklappen mklap...@gmail.com wrote:
Thanks for replies... I added a two boolean columns to join table for
owns and wants
You might be interested in modelizing the join table like this:
http://book.cakephp.org/view/1650/hasMany-through-The-Join-Model
Also, as
Hi All
I'm having a little difficulty conceptualizing the relationships when
setting up a database/models, for a app I'm starting to develop. If
I'm creating a basic inventory management application I have the
following:
Table Name | Columns
users | id, user_name, email, etc...
items | id, name
it into
the first.
Well, you can think about it. Enjoy,
John
On 12 Jan., 21:13, mklappen mklap...@gmail.com wrote:
Hi All
I'm having a little difficulty conceptualizing the relationships when
setting up a database/models, for a app I'm starting to develop. If
I'm creating a basic inventory management
If you go with the status columns you need two boolean columns one for own
and one for want, its a possible solution.
If you want to use two table you can create users_want and users_own.
The relation for each table should looks like it would be for items_users.
The reason to prefer one
it in production
environment yet :), but mayby it can help you.
--
Przemoo
--
View this message in context:
http://cakephp.1045679.n5.nabble.com/Using-USE-INDEX-or-FORCE-INDEX-in-Model-find-relationships-tp3281552p3300205.html
Sent from the CakePHP mailing list archive at Nabble.com.
Check out the new
Thanks for the reply. That's give me something to think about.
I've not used finderQuery before, I'll certainly give it some time.
Thanks again.
On Nov 27, 12:20 am, cricket zijn.digi...@gmail.com wrote:
On Fri, Nov 26, 2010 at 12:03 PM, kadanis evad.ba...@gmail.com wrote:
Just wondering
Just wondering if anyone has any suggestions on this.
I'm using Cake for a current project and the project lead is insisting
we use FORCE INDEX on the queries and table joins.
I've searched all over the web and come up empty handed so far and
don't particularly want to hand code all the sql
On Fri, Nov 26, 2010 at 12:03 PM, kadanis evad.ba...@gmail.com wrote:
Just wondering if anyone has any suggestions on this.
I'm using Cake for a current project and the project lead is insisting
we use FORCE INDEX on the queries and table joins.
I've searched all over the web and come up
Basically, can containable work without having relationships
specified? Or does containable rely on those relationships?
In some tutorials, they specify to use recursive = -1 and then
containable to get more optimized SQL. I can't help but think, what's
the point specifying the relationships
Do you mean relationships in the database or in the models? They are essential
in the models (else Cake won't know how to relate models) and although not a
Cake requirement I'd say it is paramount from a performance point of view in
the database.
Jeremy Burns
Class Outfit
jeremybu
I meant Model relationships. So, they would be required for the
containable behavior to work then?
On Nov 18, 8:38 am, Jeremy Burns | Class Outfit
jeremybu...@classoutfit.com wrote:
Do you mean relationships in the database or in the models? They are
essential in the models (else Cake won't
to be corrected, but I think recursion is redundant when using contain,
so no need to set it to -1 (although I suppose it doesn't hurt).
Jeremy Burns
Class Outfit
jeremybu...@classoutfit.com
http://www.classoutfit.com
On 18 Nov 2010, at 13:32, Dan wrote:
I meant Model relationships. So
when using contain,
so no need to set it to -1 (although I suppose it doesn't hurt).
Jeremy Burns
Class Outfit
jeremybu...@classoutfit.comhttp://www.classoutfit.com
On 18 Nov 2010, at 13:32, Dan wrote:
I meant Model relationships. So, they would be required for the
containable
recursion is redundant when using
contain, so no need to set it to -1 (although I suppose it doesn't hurt).
Jeremy Burns
Class Outfit
jeremybu...@classoutfit.comhttp://www.classoutfit.com
On 18 Nov 2010, at 13:32, Dan wrote:
I meant Model relationships. So, they would be required
On Thu, Nov 18, 2010 at 11:03 AM, Dan dannyetdi...@gmail.com wrote:
When using contain, I have to specify the $actAs = Containable for it
to work, correct?
Yes, of course. Just as with any other behavior. If you plan to use it
a lot you can put it in AppModel's $actsAs array.
And if you have
And don't forget it's $actsAs, not $actAs (cricket has identified this in his
response).
Jeremy Burns
Class Outfit
jeremybu...@classoutfit.com
http://www.classoutfit.com
On 18 Nov 2010, at 17:45, cricket wrote:
On Thu, Nov 18, 2010 at 11:03 AM, Dan dannyetdi...@gmail.com wrote:
When using
On Thu, Nov 18, 2010 at 1:02 PM, Jeremy Burns | Class Outfit
jeremybu...@classoutfit.com wrote:
And don't forget it's $actsAs, not $actAs (cricket has identified this in his
response).
I hadn't noticed. Been bit by that a couple of times (as with not
providing the keys in 'fields').
Check out
Oh my word - you just made that so easy! Thank you so much for your
detailed explanation - it is obvious you put some time into this
question for me. Thanks again - I owe you!
Check out the new CakePHP Questions site http://cakeqs.org and help others with
their CakePHP related questions.
You
How would one change the label that is generated in this example?
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,
On Thu, Oct 28, 2010 at 7:38 PM, dingerkingh dingerki...@hotmail.com wrote:
How would one change the label that is generated in this example?
label?
Check out the new CakePHP Questions site http://cakeqs.org and help others with
their CakePHP related questions.
You received this message
I will try to keep this as simple as possible. I have read through
the manual but can't seem to find what I am looking - however, I am
sure it is in there somewhere.
Here is what I am I am looking to do on a very small scale:
names
id
name
tickets
id
title
name_id
closed_by
What I need to
On Wed, Oct 27, 2010 at 7:18 PM, dingerkingh dingerki...@hotmail.com wrote:
I will try to keep this as simple as possible. I have read through
the manual but can't seem to find what I am looking - however, I am
sure it is in there somewhere.
Here is what I am I am looking to do on a very
honestly can't think of even where I should start here. Building a menu is
simple in plain php with simple relationships but it's getting pretty tricky
with all the extra levels.
Does anyone have any advice on a starting point which I could work with...
I'm trying to make it extendable
around the menu in itself but if he also goes
to the a related page (eg suburbs/view/cape-town) then the menu should know
where the user is)
I honestly can't think of even where I should start here. Building a menu is
simple in plain php with simple relationships but it's getting pretty tricky
a menu is
simple in plain php with simple relationships but it's getting pretty tricky
with all the extra levels.
Does anyone have any advice on a starting point which I could work with...
I'm trying to make it extendable in the sense that I don't want to hard code
anything.
I'm starting
Hi all.
Sorry for all these newb questions... trying to learn this stuff. Here's the
relationships and tables I have:
Relationships:
Hardware HABTM Configuration
Configuration belongsTo ConfigurationType
Tables:
configurations
- configuration_type_id
configurations_hardwares
On Tue, Aug 24, 2010 at 2:31 PM, Philip Thompson philthath...@gmail.com wrote:
Hi all.
Sorry for all these newb questions... trying to learn this stuff. Here's the
relationships and tables I have:
Relationships:
Hardware HABTM Configuration
Configuration belongsTo ConfigurationType
On Aug 24, 2010, at 6:03 PM, cricket wrote:
On Tue, Aug 24, 2010 at 2:31 PM, Philip Thompson philthath...@gmail.com
wrote:
Hi all.
Sorry for all these newb questions... trying to learn this stuff. Here's the
relationships and tables I have:
Relationships:
Hardware HABTM Configuration
Hi, thanks for getting back to me.
I definitely have all my models listed in the fixtures collection.
What we just discovered after a lot of testing is that it had to do
with $useTable being set to false. For some reason that just throws
everything out of whack. If anybody gets this in the
My best guess, without seeing your test case or fixtures, is that you
need to add the fixture to your $fixtures var in your test case.
i.e.,
class MenuItemTestCase extends CakeTestCase {
var $fixtures = array('app.menu_item', 'app.alias');
}
After doing that, they should load into the test
Hi all,
Having a strange problem with test cases here. We have two tables in
question in this one example - Alias and MenuItem.
- Alias belongsTo MenuItem
- MenuItem hasMany Alias
I am running model test cases on Alias itself. Problem is that if I
define the MenuItem hasMany Alias relationship
the contact table
Now how do I define relationships between the common contact table and
each of the remaining ones? I'd love to be able to say practice_site
hasone contact, practitioner hasone contact, client hasone
contact.
Related to my schema design, is there a (generic, reusable) way
, contact_id, qualifications)
clients (id, contact_id, emergency_id, guardian_id) // each
referencing the contact table
Now how do I define relationships between the common contact table and
each of the remaining ones? I'd love to be able to say practice_site
hasone contact, practitioner hasone contact
You can't specify a condition on a hasMany association as Cake cannot
create a join on such an association. In order to get a one to many
result set you need to run 2 queries, 1 to find the product and
another to find it's many types as such you are getting a logical
error thrown back at you.
, not just a small
piece.
Jeremy Burns
jeremybu...@me.com
On 27 May 2010, at 00:22, 朝の木 wrote:
I have three models (with controllers):
- Product: Id, Title, Type_id
- Type: Id, Description
- ProductItem: Id, Product_id, Size, Sold_time
Relationships:
- Product
it all, not just a small piece.
Jeremy Burns
jeremybu...@me.com
On 27 May 2010, at 00:22, 朝の木 wrote:
I have three models (with controllers):
- Product: Id, Title, Type_id
- Type: Id, Description
- ProductItem: Id, Product_id, Size, Sold_time
Relationships:
- Product: belongsTo(Type
I have three models (with controllers):
- Product: Id, Title, Type_id
- Type: Id, Description
- ProductItem: Id, Product_id, Size, Sold_time
Relationships:
- Product: belongsTo(Type), hasMany(ProductItem)
- Type: hasMany(Product)
- ProductItem: belongsTo(Product)
Example:
- Product:
1; 'Star
, Description
- ProductItem: Id, Product_id, Size, Sold_time
Relationships:
- Product: belongsTo(Type), hasMany(ProductItem)
- Type: hasMany(Product)
- ProductItem: belongsTo(Product)
Example:
- Product:
1; 'Star Jeans 502', 4
(...)
- Type:
4; 'Trousers'
(...)
- ProductItem:
7
controller? No special code is needed in your controller to handle
relationships, and you'd only need to add code to your User model
(e.g., var $hasMany = array('Post');) if you wanted posts to be
retrieved every time you query your user table, which you probably
don't
Can you show us the structure of your table? It seems Cake is not able
to find that field.
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.
code is needed in your controller to handle
relationships, and you'd only need to add code to your User model
(e.g., var $hasMany = array('Post');) if you wanted posts to be
retrieved every time you query your user table, which you probably
don't.
Once you have it working, 'User
code is needed in your controller to handle
relationships, and you'd only need to add code to your User model
(e.g., var $hasMany = array('Post');) if you wanted posts to be
retrieved every time you query your user table, which you probably
don't.
Once you have it working, 'User
^^ What @Andy says is right.
Simple rule of thumb for hasMany/hasOne - belongsTo
relationships ... whichever model your foreign_key is in, it belongs
to the other model.
Welcome to CakePHP, it should make learning complex PHP a lot easier
for you. I sometimes wish I hadn't taught myself a lot
@Andy says is right.
Simple rule of thumb for hasMany/hasOne - belongsTo
relationships ... whichever model your foreign_key is in, it belongs
to the other model.
Welcome to CakePHP, it should make learning complex PHP a lot easier
for you. I sometimes wish I hadn't taught myself a lot of bad
? No special code is needed in your controller to handle
relationships, and you'd only need to add code to your User model
(e.g., var $hasMany = array('Post');) if you wanted posts to be
retrieved every time you query your user table, which you probably
don't.
Once you have it working, 'User'] will be added
remove the $belongsTo piece, do your posts show up again? If
not, what else did you change? What code do you currently have in your
controller? No special code is needed in your controller to handle
relationships, and you'd only need to add code to your User model
(e.g., var $hasMany = array('Post
controller to handle
relationships, and you'd only need to add code to your User model
(e.g., var $hasMany = array('Post');) if you wanted posts to be
retrieved every time you query your user table, which you probably
don't.
Once you have it working, 'User'] will be added as an index alongside
First of all let me say I'm very new to CakePHP and complex PHP in
general. I based the blog I am working on off the tutorial on the
CakePHP website. I skipped creating ACL or a more complex management
of permissions because as of now the only people who will be posting
content will be Authorized
Try $belongsTo instead of $hasOne.
$belongsTo = array('User');
On Feb 22, 7:03 pm, deek derek.bon...@gmail.com wrote:
First of all let me say I'm very new to CakePHP and complex PHP in
general. I based the blog I am working on off the tutorial on the
CakePHP website. I skipped creating ACL
AFAIK,
In general we have three statuses for every account
created but not active (0)
activated (1)
banned (-1)
It is better to stick to one table (users), so this table have an
indexed integer field called status.
As for Active, ''Banned, etc...
It is just a convention and 9X% of the queries
Hi,
I need some guidance on how to build these model relationships.
I need to build something that allows people to book a room in an
accommodation. These are the steps.
User finds room.
User requests to stay in room
Owner accepts / declines
User Pays / finds another room.
I have 3 tables so
relationships.
I need to build something that allows people to book a room in an
accommodation. These are the steps.
User finds room.
User requests to stay in room
Owner accepts / declines
User Pays / finds another room.
I have 3 tables so far. Members, Accommodations, BookingRequests
, Owner, Booking
Can one room have more than one Guest per room?
Can one booking involve more than one room?
John
On Dec 2, 5:42 pm, onlymejosh star...@gmail.com wrote:
Hi,
I need some guidance on how to build these model relationships.
I need to build something that allows people
on how to build these model relationships.
I need to build something that allows people to book a room in an
accommodation. These are the steps.
User finds room.
User requests to stay in room
Owner accepts / declines
User Pays / finds another room.
I have 3 tables so far
.
The Post model has other BelongsTo and HABTM relationships to other
classes.
What I'd like to do is in the Post model retrieve the Media models
related to it through the Group model without retrieving any more of
the other relationships in the Post model. In other words, I'd like to
set recursive=2
relationship to a
Group model. This Group is related by HABTM to 1+ Media models.
The Post model has other BelongsTo and HABTM relationships to other
classes.
What I'd like to do is in the Post model retrieve the Media models
related to it through the Group model without retrieving any
I've got a Post model set up that has a BelongsTo relationship to a
Group model. This Group is related by HABTM to 1+ Media models.
The Post model has other BelongsTo and HABTM relationships to other
classes.
What I'd like to do is in the Post model retrieve the Media models
related
Hi, I have a model with a $belongsTo and a $hasMany relations. My
question is: is there a way to decide at RUNTIME when load or not load
related model data?
I have an index method in my controller where I need only my parent
model data and then a view/id method where I need also the related
Use 'recursive' or 'contain' params in your find() calls.
On Thu, Sep 17, 2009 at 8:17 AM, DierRe die...@gmail.com wrote:
Hi, I have a model with a $belongsTo and a $hasMany relations. My
question is: is there a way to decide at RUNTIME when load or not load
related model data?
I have an
Ok let me explain my real example so you can understand me better (BTW
'contain' is not in the cookbook I think).
I have ParentModel, Child1Model and Child2Model. They're both
$hasMany. What can I do to show only Child1Model?
Do I use 'contain'?
On 17 Set, 18:37, brian bally.z...@gmail.com
$this-ParentModel-find(
'all',
array(
'conditions' = array(...),
'contain' = array('Child1Model')
)
);
That will cause Cake to effectively set recursive to -1 BUT grab just
the Child1Model data.
On Thu, Sep 17, 2009 at 2:55 PM, DierRe
This brought the solution:
http://bakery.cakephp.org/articles/view/quick-tip-doing-ad-hoc-joins-in-model-find
Marco
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
CakePHP group.
To post to this group, send email
1 - 100 of 320 matches
Mail list logo