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' =>
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'),
Hi,
I have a tricky Associationsproblem:
The Data is retrieved by an XML Request and Stored locally. For that i
wrote a console shell script which works fine at this time.
Following DB Structure:
CREATE TABLE `hotel_types` (
`id` int(11) NOT NULL auto_increment,
`hoteltype_id` int(255) NOT
Did you already try 'conditions' => 'users.deleted = "0"' ?
The real table name is 'users', not 'User'...
[ ]'s
LP
2007/8/5, Ruud Gâst <[EMAIL PROTECTED]>:
>
> Hello there,
>
> I've got a simple construction of two models: users and familymembers;
> every user belongs to a familymember and a fa
Well, the condition is not included in the SQL. So that is why I'm not
getting any errors when I create a condition that should create an
error...
I have removed all files in app/tmp/cache/models, if that is the right
way to clear the model caches then I have. If not, how can I do that?
Thanks f
On Aug 6, 2007, at 4:49 PM, Ruud Gâst wrote:
>
> No-one has an answer? I'd say a lot of people use the same
> construction so it won't be that hard ... I just don't know how.
What happens when you turn DEBUG up to 2 or so? Does the SQL include
the condition?
Have you tried clearing the model
No-one has an answer? I'd say a lot of people use the same
construction so it won't be that hard ... I just don't know how.
On Aug 6, 3:01 am, Ruud Gâst <[EMAIL PROTECTED]> wrote:
> Hello there,
>
> I've got a simple construction of two models: users and familymembers;
> every user belongs to a f
Hello there,
I've got a simple construction of two models: users and familymembers;
every user belongs to a familymember and a familymember has one user.
So the database looks like this:
`familymembers` (
`id` int(11) auto_increment,
`firstname` varchar(20),
`lastname` varchar(100),
`gen
Hi,
> thanks, it works. had to use:
> $this->User->unbindModel(array('hasMany'=>array('Article')));
>
> in Article model.
cool, though you could also unbind the (any) association from within
your controller, in this case you have ArticlesController, which means
you can access User as a child of
thanks, it works. had to use:
$this->User->unbindModel(array('hasMany'=>array('Article')));
in Article model.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Cake PHP" group.
To post to this group, send email to
> I've some association explained here, and they works pretty well.
> However I want to be able to fetch a User's Profile when querying
> Article model.
it should be available, like so:
$data['Article']['User']['Profile']
if you're also getting every article that a user has made, then yes
I'd u
hi guys,
I've some association explained here, and they works pretty well.
However I want to be able to fetch a User's Profile when querying
Article model.
I've tried with recursion, but it will just fetch every article that
belongsTo this User, and this is not what I want.
Should I work with bin
Nate, this appeared to work until I got to the show() action, which
lists all the Menus. There are over 300 menus in the table, and when
Cake tries to find all the product data for each of the 34 product
fields for each of the 300 menus, it chokes. It can't complete the
request. I get a server err
Thanks, Nate. You've been my saving grace on this project!
I ended up having to put almost all 34 in separate manual find()
actions, because of recursion I needed on other associations in the
Menu class, but it eventually worked!
--~--~-~--~~~---~--~~
You receive
Wow, that's a tough one. The only thing I can think of is removing
three or four associations from $belongsTo, and doing them manually
Menu::afterFind( ), which would look something like this (keep in mind,
this code is off-the-cuff and completely untested):
class Menu extends AppModel {
/// ..
I have an app that is basically a menu of products. A user selects
products in 34 drop-downs, and then it spits out a custom menu in PDF
format. I have the associations set up as follows:
///Model 'Enhancement' (excerpt)
var $hasMany = array(
'ProductOne' => ar
I found it. Missed a semicolon in an unrelated association variable
definition. Thanks for taking a look. This is actually a good example
of how to do multiple associations between two models, for anyone
browsing. It works great!
--~--~-~--~~~---~--~~
You received
Hmm, I've just tried this in PhpEclipse which usually shows syntax
errors and it's seems fine. Maybe your best bet is to start taking out
each association until it works and they you will be able to find the
error?
--~--~-~--~~~---~--~~
You received this message b
The error should tell you what line the error is happening on. Check
that line out.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To
I have an app I'm trying to convert to Cake, which basically spits out
a menu of products. Therefore, the Menu class (and others) needs to
hold many different products in several fields. I do not have a lookup
table, because the app written procedurally (sp?) didn't need one. I've
tried to set up
21 matches
Mail list logo