3 answers
0 votes
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...
2 answers
0 votes
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' =...
2 answers
0 votes
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...
1 answer
0 votes
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...
0 answers
0 votes
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
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
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
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...
1 answer
0 votes
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...
0 answers
0 votes
How do I get relational data from bootstrapped models?
Hi all. I am new to CakePHP and I am building a CMS with the following folder structure:
/public_html/cake/
/public_html/admin/
/public_html/frontend/
index.php
I have setup the bootstrap.php file in the frontend to look for models in the admin app. ...