I sorted it out by using the HasMany thorough relation and by correcting
the $data feed.
On Friday, February 6, 2015 at 8:46:08 PM UTC, gt0p wrote:
>
> I am trying to bind 3 tables and I am having problems with proper
> relations.
> Table users (pk id), books (pk id), users_books (user_id, book
I already missed one valid model association - has many through, and that
solved my issue. Thanks anyway for the reply!
On Monday, February 9, 2015 at 5:25:58 PM UTC, John Andersen wrote:
>
> Assuming you are using CakePHP 2.x
>
> It is a good idea to define a primary key in your HABTM table - in
Assuming you are using CakePHP 2.x
It is a good idea to define a primary key in your HABTM table - in the
books_users table (name should be alphabetic order, but you can deviate).
Thus your table definition is:
books_users
id, book_id, user_id
What is your comment table reflecting?
1) comments
I am trying to bind 3 tables and I am having problems with proper
relations.
Table users (pk id), books (pk id), users_books (user_id, book_id),
comments (pk and foreign key book_id, user_id -> with reference to
users_books)
Here are the models:
Book
public $hasAndBelongsToMany = array(
uot; to reference parts.id. All now fine!
--
View this message in context:
http://cakephp.1045679.n5.nabble.com/Bake-and-model-associations-tp5717978p5717979.html
Sent from the CakePHP mailing list archive at Nabble.com.
--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http:
egroups.com [mailto:cake-php@googlegroups.com] On Behalf
Of lowpass
Sent: 06 September 2013 01:51 AM
To: cake-php@googlegroups.com
Subject: Re: Help with Model associations and find
If I understand correctly, you want the latest DataImport record, and all of
its associated ClientData records,
'contain' => array(
'TelemetryData' => array(
'Hospital' => array(
'Province'
)
)
),
'recursive' => 3
)
)
Thanks for the help!
From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Beha
;]['Province']['id'] = 9;
> ClientData[1]['Hospital']['Province']['name'] = 'Gauteng';
> ClientData[2]['id'] = 6;
> ClientData[2]['name'] = 'Client Name 2';
> ClientData[2]['DataImport'][
x27;Hospital']['Province']['name'] = 'Eastern Cape';
I'm not sure if this helps at all?
I basically loop through ClientData after pulling this, adjust some values
according to algorithms and then print it out into a table. In that table I
need to print the P
y first complex db design within the framework.
>
> I know how to do this in mySQL, but cannot figure out how to use Cake's
> Model associations and find method to get it done. - All associations are
> set up in the Models already.
>
> I have a table 'ClientData
use Cake's
Model associations and find method to get it done. - All associations are
set up in the Models already.
I have a table 'ClientData'. It has foreign keys to 2 other tables,
Hospital and DataImport. This is a manyToOne relationship (I think -
basically, many ClientData
Anyone? :)
On Fri, May 17, 2013 at 4:04 PM, Alex Bovey wrote:
> Hi all,
>
> In my Cake 2.3 app I'm using saveAll($this->request->data, array('deep' =>
> true)) to save deep model associations and the validation is working fine.
> My input fields for any
Hi all,
In my Cake 2.3 app I'm using saveAll($this->request->data, array('deep' =>
true)) to save deep model associations and the validation is working fine.
My input fields for any deeply associated models have the error class
applied if I try to submit the form having l
I seem to have resolved this, but I don't think it's the most efficient
query:
public function getStudents(){
$userId = $this->Auth->user('id');
$endusers = $this->RoleUser->findAllByuser_id($userId,
array('RoleUser.enduserid','RoleUser.user_id')); //Get the enduserid's for
all the roles I h
On Sun, Dec 9, 2012 at 2:30 PM, Md wrote:
>
> array ('RoleUser.id = ' => $userId))); //this is the current logged in user
RolesUser
--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
---
You received this message because you are subscribed t
I am having trouble returning a query. I have the following setup
Users - users class of all users in the system.
Roles - roles class with a set of available roles. E.g. teacher, student,
tutor
RoleUsers - a mapping table between users and roles as a single user can
have multiple roles.
My U
After linking two models together with, for instance, using the $hasMany
and $belongsTo definitions should I expect to see either a multi-select
form input element in the add and edit scaffolded views for the model with
the $hasMany definition? I would expect to get something in there but I
don
Hi cake lovers,
I've just uploaded part 4 of my cakePHP basics tutorial series.
In this one I'll explain how you can create associations in your models to
get associated data from other models when you retrieve data.
http://blog.the-nerd.be/2012/08/cakephp-basics-tutorial-part-4/
Hope you like
cricket, thanks for the answear, but it´s not exactly this... I have a menu
wich is generated dinamically in ALL pages of the site, so it´s a part of
the layout and the categories information needs to be in all pages.
Em sexta-feira, 10 de agosto de 2012 00h23min04s UTC-3, cricket escreveu:
>
>
Yes i do... I resolved the problem using requestAction, but i know that´s
not correct.
Em quinta-feira, 9 de agosto de 2012 17h28min29s UTC-3, Mark Wratten
escreveu:
>
> Do you have var $belongsTo = array('Category', 'Product'); in your
> CatProduct model?
>
> On Thursday, August 9, 2012 10:43:
I'm not sure I follow all of that but I think what you want is a list
of all Categories for the main page, and all Products for a given
Category. If that's the case, I would set the main page as
CategoryController::index(). This is from one of my projects:
Router::connect(
'/catalog',
Do you have var $belongsTo = array('Category', 'Product'); in your
CatProduct model?
On Thursday, August 9, 2012 10:43:43 AM UTC-4, André Luis wrote:
>
> Hi people, it´s me again!
>
> I am using a habtm relationship in my application, it works 100% fine...
> But the Product menu is created dinam
I´ve noticed that if i try do use the CatProduct in AppModel, the Product
model becomes a AppModel object, and not a Product object anymore
=(
--
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups
Now when i try to use the find all in appcontroller it seems to remove my
behaviors for latter uses, what i am doing wrong??
--
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscri
Hi people, it´s me again!
I am using a habtm relationship in my application, it works 100% fine...
But the Product menu is created dinamically with it´s Categories... so i
have Product model and the Category model with habtm relationship between
them.
In AppController i have to set at beforeFi
In you code you have 'className' => 'Bookings'. Shouldn't that be
'className' = 'Booking' ?
You should also be able to shorten it to - var $belongsTo =
array('Booking') as you are using booking_id as your foreign key.
MArk
On Wednesday, June 27, 2012 2:34:25 AM UTC-4, Sanfly wrote:
>
> Sorry,
This seems more like an HABTM association. A Booking can have/belong
to many BookingDate and vice versa.
I wonder, though, if it might be better to drop the BookingDate model
and instead use date ranges. Something like date_from & date_to, or
arrival & departure, in the bookings table.
On Wed, Ju
Sorry, I'll repost this - my database is Bookingdate not Bookingnight
Hi
Im having some trouble with a model association - yes, I have tried the
manual!
For each Booking I have, I can have many Bookingnights
*Booking*
Booking.id
*Bookingdate*
Bookingdate.id
Bookingdate.booking_id
In my
Hi
Im having some trouble with a model association - yes, I have tried the
manual!
For each Booking I have, I can have many Bookingnights
*Booking*
Booking.id
*Bookingnight*
Bookingnight.id
Bookingnight.booking_id
In my Booking model, I am able to get all the associated Bookingnights
wi
On Thu, May 24, 2012 at 7:37 PM, hill180 wrote:
> Solved: But I don't know why. This but this code puts the data where I
> want it, and without the index error:
>
Good to hear, glad I could help.
Mike
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check
Solved: But I don't know why. This but this code puts the data where I
want it, and without the index error:
'Contact' => array(
'className'=>'CONTACT',
'foreignKey' => false,
'finderQuery' => 'SELECT Account.AccountID as Contact__ACCOUNT_ID,
contact.contact_full_name as Contact_
Ok.
Sorry for the last email.
it made no sense:
What I was trying to say is that I am getting
*Notice* (8) : Undefined index: Contacts
I copied the SQL Dumb (from the finderquery) in MSSQL Manager and it works.
Just doing a debug($results) which is the results of the find query.
Also it gets m
Thank you so much. I think I am 99% there.
Get the following error three times, (that is actually how many contacts
are in the DB for the customer I was looking up.
debug($results);
*Notice* (8) : Undefined index: Contacts [*
CORE\Cake\Model\Datasource\DboSource.php*, line *1412*]
Code Context
On Thu, May 24, 2012 at 3:14 PM, hill180 wrote:
> Yes.
>
> As a disclaimer, I didn't write the original schema.
>
> Account_ID is for the systems account number (primary key)
> Account is for the logical account number (used by the company)
>
> The Account Address table use the Account_ID as the f
Yes.
As a disclaimer, I didn't write the original schema.
Account_ID is for the systems account number (primary key)
Account is for the logical account number (used by the company)
The Account Address table use the Account_ID as the foreign key, but the
Contact Table uses the Account Number as t
On Thu, May 24, 2012 at 1:50 AM, hill180 wrote:
> AccountID = AccountID on the Account and the Address for the Account, no
> problems here.
>
>
> The problem is the contacts.
>
> The join is Contact.Account_id = Accounts.Account (not Account_ID)
>
> Error: SQLSTATE[42000]: [Microsoft][SQL Server N
*Cake *PHP 2.
*public *$useTable = 'Accounts';
/**
* Primary key field
*
* *@var* string
*/
*public *$primaryKey = 'AccountID';
*public *$hasMany = *array*(
'Address' => *array*(
'className' => 'AccountAddress',
'foreignKey' => 'AccountID',
'conditions' => '',
'fields' => '',
'ord
If user is not logged in, then in Event form:
echo $this->Form->input('Event.user_id', array('type' => 'hidden', 'value'
=> $user['User']['id']));
and in controller:
$this->Event->create($this->request->data);
if ($this->Event->save()) {
...
Do not forget to use SecurityComponent in AppControl
I should have specified - the user doesn't necessarily have to be the
logged in user. It could be any user, in which case $this->Auth->user('id')
doesn't fit my needs. This is closer, I just need to figure out how to grab
the user id from the users/view page.
On Saturday, May 5, 2012 10:33:09 A
Trying to learn it through straight code before I dive into any console
commands. One of the biggest reasons that I've put off using MVC is because
I like to feel like I'm in control. Yes, probably dumb, but it makes more
sense to my fragile brain.
On Saturday, May 5, 2012 7:57:13 AM UTC-6, Mic
$this->Event->create($this->request->data);
$this->Event->set('user_id', $this->Auth->user('id'));
if ($this->Event->save()) {
...
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others
You should take some time to learn how to use bake. It will setup the
basics for you based on your database and will serve as a great
example of how to do things.
http://book.cakephp.org/2.0/en/console-and-shells/code-generation-with-bake.html
There are many tutorials out there about setting it u
MVC Beginner here - I have created a database with a USER table which
hasMany EVENTS, and conversely have set the EVENTS belongsTo USER
Here's my question: When I want to add an event from a user page
(users/view), how do I automatically associate that event(event/add) with
the user in the data
On Tue, Mar 27, 2012 at 20:40, Augey Mikus wrote:
> I am building an eLearning site in CakePHP that has models: Course,
> Test, Question, Answer, and others.
>
> Here are my associations:
>
> Course hasMany Test
> Test belongsTo Course
> Question belongsTo Test
> Question hasMany Answer
> Answer
you could replace
$test = $this->Test->read(null, $id);
$test['Question'] = $this->Test->Question->find('all'); //I added this
line...
with
$test = $this->Test->find('first', array(
'conditions'=>array('id'=>$id),
'recursive'=2
));
the conditions array indicates which test records to get
I am building an eLearning site in CakePHP that has models: Course,
Test, Question, Answer, and others.
Here are my associations:
Course hasMany Test
Test belongsTo Course
Question belongsTo Test
Question hasMany Answer
Answer belongsTo Question
This model association works fine in most circums
I think I may have just answered my own question in writing that! If
I use the 2 model & added a beforeSave to set the type when saving to
set the 'type' field. & the condition on the relationship, then each
of the ticket type models will not be able to see the transactions
that relate to the othe
Hi there,
Am have a dilemma...
I have a store that sells eTickets & physical tickets. Details of the
sale of each type of ticket are stored in 2 tables (etickets &
ptickets).
I also have a table that stores details of when a user is directed off
to PayPal to pay for their tickets (paypal_transa
rent "conditions array" for relations.
> >> Personally, I think this should be addressed in 2.1 as a bugfix to be
> >> fixed (if I add a global condition it should always be applied, no
> >> matter what).
>
> >> As of right now you probably need to m
you probably need to manually join the conditions.
>>
>> On 29 Nov., 18:16, Jeremy Burns wrote:
>>
>>
>>
>>
>>
>>
>>
>>> I've noticed that if I have conditions on model associations, for
>>> example:
>&
Burns wrote:
>
>
>
>
>
>
>
> > I've noticed that if I have conditions on model associations, for
> > example:
>
> > $hasMany = array(
> > 'ActiveUser' => array(
> >
ht now you probably need to manually join the conditions.
On 29 Nov., 18:16, Jeremy Burns wrote:
> I've noticed that if I have conditions on model associations, for
> example:
>
> $hasMany = array(
> 'ActiveUser' => array(
> '
I've noticed that if I have conditions on model associations, for
example:
$hasMany = array(
'ActiveUser' => array(
'className' => 'User',
'foreignKey' => 'group_id',
'c
Your first two examples will not work as models are not plural.
http://book.cakephp.org/view/936/Importing-Controllers-Models-Components-Behaviors-
HTH, Paul.
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask
Not sure what the issue is, but in general I'd recommend that you set recursive
to -1 in your app_model and then use the Containable behaviour; it gives you
total control and my well solve your issue (as well as bring other
improvements).
Jeremy Burns
Class Outfit
http://www.classoutfit.com
O
Due to a client's desire to have URLs that defy Cake logic, i have
decided to use the pages controller to organize my app.
most the site's functionality occurs from one page through ajax so i
thought i'd use pages as the home base and access other controllers
and models.
so i decided to import the
On Sat, Apr 16, 2011 at 2:34 PM, cricket wrote:
>
> public function add()
> {
> if (!empty($this->data))
> {
> // attempt to save
> }
>
> $this->set(
> 'fabricantes',
> $this->Carro->Fabricante->find('list')
> );
> }
>
On Fri, Apr 15, 2011 at 10:45 AM, Uriel Juliatti
wrote:
> Hey everybody
>
> I'd like to know how to display a list of
> Manufacturers (associated with Cars) in a combobox when I create cars.
>
> My Mysql query returns it:
>
> SELECT `Carro`.`id`, `Carro`.`fabricante_id`, `Carro`.`nome`,
> `Carro`.
Hey everybody
I'd like to know how to display a list of
Manufacturers (associated with Cars) in a combobox when I create cars.
My Mysql query returns it:
SELECT `Carro`.`id`, `Carro`.`fabricante_id`, `Carro`.`nome`,
`Carro`.`modelo`, `Carro`.`blindado`, `Carro`.`cor`, `Carro`.`ano`,
`Carro`.`pre
om day 1 like this so also would be curious to see
> > > what others are doing in regards to the other params available for
> > > relations.
>
> > > Good question :)
>
> > > K
>
> > > -Original Message-
> > > From: cake-php@googlegr
o also would be curious to see
> > what others are doing in regards to the other params available for
> > relations.
>
> > Good question :)
>
> > K
>
> > -Original Message-
> > From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Beha
ent: Wednesday, March 02, 2011 3:57 PM
> To: CakePHP
> Subject: How to properly use "conditions" in model associations
>
> Hi everyone,
>
> I'm wondering what is the 'proper' or 'suggested' way of using
> "conditions" in model associa
ly use "conditions" in model associations
Hi everyone,
I'm wondering what is the 'proper' or 'suggested' way of using
"conditions" in model associations. I'm using an Activity model to log
activities performed throughout my app. I then use this table t
Hi everyone,
I'm wondering what is the 'proper' or 'suggested' way of using
"conditions" in model associations. I'm using an Activity model to log
activities performed throughout my app. I then use this table to
output activity feed / notifications style s
On Wed, Jan 5, 2011 at 9:44 AM, roundrightfarm wrote:
> Thanks for your help. Got it to work... but
> can you please explain why this didn't work
>
> $orders = $this->Order->find('all',
> array('conditions'=>array('Order.week_id'=>$week_id)),
> array(
Thanks for your help. Got it to work... but
can you please explain why this didn't work
$orders = $this->Order->find('all',
array('conditions'=>array('Order.week_id'=>$week_id)),
array('contain' => array('Box' => array('Item')))
);
The Containable behaviour is your very best friend:
http://book.cakephp.org/view/1323/Containable
Jeremy Burns
Class Outfit
jeremybu...@classoutfit.com
http://www.classoutfit.com
On 5 Jan 2011, at 13:10, roundrightfarm wrote:
> I'm having to do a find('all') with recursive = 2 to get at the da
I'm having to do a find('all') with recursive = 2 to get at the data I
need in my array. Unfortunately using this level of recursion also
pulls in a bunch of unneeded data, creating a monster array which is
stretching the memory limits.
Is there some syntax (perhaps involving 'fields') that will
See here:
http://groups.google.com/group/cake-php/browse_thread/thread/7bfef9785d10d2d5
Jeremy Burns
Class Outfit
jeremybu...@classoutfit.com
(t) +44 (0) 208 123 3822
(m) +44 (0) 7973 481949
Skype: jeremy_burns
http://www.classoutfit.com
On 15 Oct 2010, at 13:52, deafpanda wrote:
> Hello,
>
>
See here:
http://groups.google.com/group/cake-php/browse_thread/thread/7bfef9785d10d2d5
Jeremy Burns
Class Outfit
jeremybu...@classoutfit.com
http://www.classoutfit.com
On 15 Oct 2010, at 13:52, deafpanda wrote:
> Hello,
>
> Sorry if this question is really stupid, I'm new to cake and I'm sur
Hello,
Sorry if this question is really stupid, I'm new to cake and I'm sure
I'm missing something obvious but Google isn't helping me...
I'm following the tutorials in the cakephp book, and am on to the ACL
tutorial. I created all the tables and baked the models, controllers
and views but when
Is there a best practice or rule of thumb to work from when defining model
associations?
It seems pretty cut and dry and there's not much that you can really mess
up.
I know this problem has been brought up here in the past but I'm still
unable to find a solution after reviewing old
The results are perfectly correct for the code you are running; you are
finding all Trackers. Your code:
$this->set('trackers', $this->User->Tracker->find('all'));
... is saying "go to the User model, then leap out to the Tracker model and
bring me back all Trackers".
To filter the search, pa
I'm in the process of creating my first web application with CakePHP,
however I've run into some problems. I'll just start with the code:
class User extends AppModel
{
public $name = 'User';
public $belongsTo = 'Group';
public $hasMany = array(
'Tracker' =>
Oops, forgot that I also moved them into separate Plugins - fixed the
problem now with a simple bit of common sense!
Cheers!
On May 12, 12:47 pm, "WoJo&Co" wrote:
> Hi,
>
> Quick question about Cake and model associations.
>
> I had an association that worked fine
Hi,
Quick question about Cake and model associations.
I had an association that worked fine:
User hasOne UserAccount
fk: UserAccount.user_id
UserAccount belongsTo Club
fk: UserAccount.club_id
I have now changed this, so that
User hasOne UserAccount
fk: UserAccount.user_id
UserAccount
Thanks for taking a look at that LunarDraco. At first, the database
was going to be configured with no surrogate keys where there was a
logical candidate key. At least for parent tables. Then I found out
that cakephp does not support compound keys, so I had to abandon that
plan. Also, I found out t
The problem I see with your model is in your ZipLocation you have the
code set to a PK.
The Problem:
It is often thought that a zipcode belongs to only one city. And that
a city can have many zipcodes. There are no such rules in the postal
system.
One zip code could and often overlaps many city b
;
> Thanks.
>
> On 17 mar, 23:41, TheHerk wrote:
>
>
>
> > Here is a link to a screenshot of a class diagram I am working on,
> > with noted model associations. There are several relationships in the
> > diagram that feel wrong to me. The one in the diagram that
Hi, TheKerk, morning!
Can you post the models association's code here?
Thanks.
On 17 mar, 23:41, TheHerk wrote:
> Here is a link to a screenshot of a class diagram I am working on,
> with noted model associations. There are several relationships in the
> diagram that feel wrong
and you correctly, then you consider the ZipLocation to be
> > > > the parent of the State?
>
> > > > My understanding of the situation is the reverse, one State may have
> > > > one or more ZipLocations, so one ZipLocation belongs to one State.
>
> > > >
of the State?
>
> > > My understanding of the situation is the reverse, one State may have
> > > one or more ZipLocations, so one ZipLocation belongs to one State.
>
> > > So your diagram looks correct with regard to the relationship between
> > > ZipLocation an
one State may have
> > one or more ZipLocations, so one ZipLocation belongs to one State.
>
> > So your diagram looks correct with regard to the relationship between
> > ZipLocation and State :)
> > Enjoy,
> > John
>
> > On Mar 18, 4:41 am, TheHerk
n
> ZipLocation and State :)
> Enjoy,
> John
>
> On Mar 18, 4:41 am, TheHerk wrote:
>
>
>
> > Here is a link to a screenshot of a class diagram I am working on,
> > with noted model associations. There are several relationships in the
> > diagram that
between
ZipLocation and State :)
Enjoy,
John
On Mar 18, 4:41 am, TheHerk wrote:
> Here is a link to a screenshot of a class diagram I am working on,
> with noted model associations. There are several relationships in the
> diagram that feel wrong to me. The one in the diagram that il
Here is a link to a screenshot of a class diagram I am working on,
with noted model associations. There are several relationships in the
diagram that feel wrong to me. The one in the diagram that illustrates
this is between ZipLocation and State. In this case, state is
enumerated in its own table
I have two associated models, Series (hasMany) and SeriesTitle
(belongsTo) each use the Searchable behavior.
While the association is active and I try to save to the SeriesTItle
model, all behaviors break as for some reason $this->model contains
the Series model rather than the SeriesTitle.
This o
these textures there is a separate model
name texture_info to track stats like gender of bounding radius of a
texture.
If a I understand the Cake way of doing model associations, I would
have to change the models to rather look like:
[code]
[/code]
Thus I'd move the texture ID's curr
I've managed to get it working. The answer was simple, yet not
obvious.
In order to get these deep level associations working you need to add
the association in the first model. In my case that's Model1 or
CourseResult.
This is how:
var $belongsTo = array(
'Course' => arra
I have a legacy database and I am unfotunately unable to change the
table structure.
I have the following tables:
CODE
scheduled_models (no primary key set, but should be model_id)
model_idint(11) auto_increment
model_name varchar(15)
... and other fields
and:
CODE
schedule_dat
Hey folks,
There is this problem I am facing at the moment. Not sure how to solve it.
So, my Gallery
var $hasOne = array(
'MainPhoto' => array(
'className' => 'Upload',
'foreignKey' => false,
'fields' => array('MainPhoto.filename'),
I see what you mean. My eyes glazed over. :-)
How about posting the output of debug($this->paginate) (after you've
set the conditions)?
On Sun, Sep 13, 2009 at 4:41 PM, martinp wrote:
>
> It's quite complicated as I have to deal with some craziness in the
> form search form submission. I don't t
It's quite complicated as I have to deal with some craziness in the
form search form submission. I don't think this is the problem, but
here's the function that sorts out the conditions:
private function setPreConditions() {
$preConditions = $this->postConditions($this->da
I missed Miles's post, also. I, too, think your $conditions looks
strange. Can you post the actual code (not debug output)?
On Fri, Sep 11, 2009 at 11:57 AM, martinp wrote:
>
> Hello
>
> Thanks for your replies. I thought I was watching this topic, but
> wasn't aware that the discussion had conti
Hello
Thanks for your replies. I thought I was watching this topic, but
wasn't aware that the discussion had continued without me!
Brian - I think you've hit the nail on the head regarding my
containment problem, but I still don't have it working.
Miles J - I assure you they are all belongsTo as
Correct me if im wrong, but are you allowed to use $conditions the way
he is? On top of that, I feel like were not seeing all the queries,
all of those associations cant be belongsTo.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the
On Fri, Sep 4, 2009 at 2:16 PM, Miles J wrote:
>
> But its in the where clause, so hes supplying it himself.
>
> LEFT JOIN `courses` AS `Course` ON
> (`CourseResult`.`course_id` = `Course`.`id`) WHERE
> `Course`.`course_type_id` = 1 AND `School`.`city` = 'London' AND
> `School`.`country_id` = '225
But its in the where clause, so hes supplying it himself.
LEFT JOIN `courses` AS `Course` ON
(`CourseResult`.`course_id` = `Course`.`id`) WHERE
`Course`.`course_type_id` = 1 AND `School`.`city` = 'London' AND
`School`.`country_id` = '225' AND ((`CourseLevelMin`.`order` <= '1')
OR (`Course`.`cours
On Fri, Sep 4, 2009 at 11:55 AM, Miles J wrote:
>
> No its not.
>
> Error: 1054: Unknown column 'School.city' in 'where clause'
>
> That means you dont have a column named city on your school table/
> model, thats not caused by the containment.
It *appears* that way, yes. But remember that "Schoo
No its not.
Error: 1054: Unknown column 'School.city' in 'where clause'
That means you dont have a column named city on your school table/
model, thats not caused by the containment.
On Sep 4, 1:12 am, martinp wrote:
> Haven't I got MySQL errors because my model's aren't being contained?
>
> O
1 - 100 of 195 matches
Mail list logo