Questions tagged with relationships

1 answer

0 votes

Asked by rjtman, 3 weeks, 2 days ago in

Creating HABTM relationships within a table

I'm currently making an app that stores genealogical information about people. As part of this, I need to be able to distinguish relationships between people, such as a parent-child, sibling, etc.

I have a table that contains people, but what is...

1 answer

0 votes

Asked by deathau, 2 weeks, 4 days ago in

Undefined property error, but relationships seem correct

I'm having a slight problem that I can't figure out, but should be really simple.

I have the following model structure:


ProspectiveQuote [hasMany] QuoteUnit [belongsTo] Unit

but in my ProspectiveQuotesController the...

0 answers

0 votes

Asked by asanoki, on 26/5/10 in

Problem with database cascade relationships.

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:...

1 answer

0 votes

Asked by kendugu, on 25/6/10 in

Containable Behavior that Returns All Siblings

I'm using the Containable behavior. I have the following structure:

User hasAndBelongsToMany Teams

I'm looking for a containment that, given the current user, returns the team and then all other users in that team, like...

1 answer

0 votes

Asked by pastryking, 1 week, 3 days ago in

Do I have to use the InnoDB database Engine to enjoy the relationship model in cake php?

I currently have a database running on the Myisam Engine. I am trying to link various tables and their foreign keys together so when i retrieve an object I have the associated information in the object too. I have executed this code wise (using...

2 answers

0 votes

Asked by tzsoft, on 21/4/10 in

HasMany/Belongs relationship not working

Hi,

I am using 1.2.6 and I have 2 models User and UserType: User belongsTo UserType and UserType hasMany User.

The baked code is:

class User extends AppModel

{

var $name = 'User';

var $belongsTo = array('UserType' = array('className' =...

1 answer

0 votes

Asked by GnarlyYoyo, on 2/5/10 in

Model that belongs to several models

Hello,

Suppose that I have a model Building, which has many Flat

Each flat has many Window, but there are also some Window that are associated directly to a Building and do not belong to any Flat

In summary:

Building has many Window

Flat has many...

2 answers

0 votes

Asked by GnarlyYoyo, on 25/4/10 in

Duplicating a record and the associated records

Hello,

I have a database with relationships between tables.

Let's say I have a table called Movies and each Movie has many Frame.

I want users to be able to edit their Movie without affecting the Movie other users can see, which stays on-line.

So...

3 answers

0 votes

Asked by seph429, on 31/1/10 in

Relationship Problem

I am trying to configure CakePHP to act as a REST API for an app i'm writing.

I have 3 tables:


dishes {
 id,
 name,
 description
}

users {
 id,
 name,
 email
}

dishes_users {
 id,
 user_id,
 dish_id
}

I would like it so that when someone visits...

<< previous next >>