Re: Problem with hasOne Relation

2010-10-11 Thread Jonathan Sibley
Hey Guys, Great help... I just started with CakePHP and I'm tuning in to the Google Group to pick up some things. I learned a lot through this thread. Thanks for that. Best, Jonathan On Oct 10, 2:25 pm, Raphi wrote: > Ahh thank you guys so much! > > Adding the "url" to the form-helper did the

Re: Problem with hasOne Relation

2010-10-10 Thread Raphi
Ahh thank you guys so much! Adding the "url" to the form-helper did the trick. I'm using the Auth- component so I'll use $this->Auth->user('id') to identify the user. I also deleted the "belongsTo" statement from my user_profile model and everything is working in the exact same way so this really

Re: Problem with hasOne Relation

2010-10-09 Thread and
Sometimes, if you use both 'hasOne' and 'belongsTo' it doesn't work. I experienced it very often. Try just to use one of them. And the second point is that, if you have typed it here correctly, your $belongsTo is not correct. $belongsTo = array(''); but try it without belongsTo. I had those iss

Re: Problem with hasOne Relation

2010-10-09 Thread cricket
On Fri, Oct 8, 2010 at 1:41 PM, Raphi wrote: > Ok let me try to explain. > > I have two tables involved: users, user_profiles > > Of course there is a model-file to any of the tables so: user.php, > user_profile.php > The models are linked via a "hasOne"(parent key user_id) relationship. > (which

Re: Problem with hasOne Relation

2010-10-08 Thread Raphi
Ok let me try to explain. I have two tables involved: users, user_profiles Of course there is a model-file to any of the tables so: user.php, user_profile.php The models are linked via a "hasOne"(parent key user_id) relationship. (which is working perfectly). But now I want to implement a method

Re: Problem with hasOne Relation

2010-10-04 Thread cricket
On Sun, Oct 3, 2010 at 4:49 PM, Raphi wrote: > Hi, thank you for you quick response. Unfortunately I neither do use > AJAX nor have the data saved in the users table. I guess I have to use > two controllers anyway. :( Well, perhaps you could state your problem clearer, then. What is the schema of

Re: Problem with hasOne Relation

2010-10-04 Thread Raphi
Hi that doesn't work. Cake takes the array and outputs it as html attributes to the form tag: echo $form->create('UserProfile',array('controller' => 'users', 'action' => 'editUser')); gives me: '') array the controller seems to be predefined by conventions. So a create('UserProfile') form w

Re: Problem with hasOne Relation

2010-10-04 Thread Hank
echo $form->create('UserProfile'); to echo $form->create('UserProfile',array('controller' => 'users', 'action' => 'editUser')); On Oct 3, 11:01 am, Raphi wrote: > Hi there, > > I'm new to Cake and now I seem to have a little understanding problem. > The situation is this: > > I have a UsersCont

Re: Problem with hasOne Relation

2010-10-03 Thread Raphi
Hi, thank you for you quick response. Unfortunately I neither do use AJAX nor have the data saved in the users table. I guess I have to use two controllers anyway. :( On 3 Okt., 22:36, cricket wrote: > On Sun, Oct 3, 2010 at 2:01 PM, Raphi wrote: > > Hi there, > > > I'm new to Cake and now I se

Re: Problem with hasOne Relation

2010-10-03 Thread cricket
On Sun, Oct 3, 2010 at 2:01 PM, Raphi wrote: > Hi there, > > I'm new to Cake and now I seem to have a little understanding problem. > The situation is this: > > I have a UsersController and a User Model. Then there is an > editProfile() method within my UsersController. Of course I also > created

Problem with hasOne Relation

2010-10-03 Thread Raphi
Hi there, I'm new to Cake and now I seem to have a little understanding problem. The situation is this: I have a UsersController and a User Model. Then there is an editProfile() method within my UsersController. Of course I also created a view (users/edit_profile.ctp). My problem is that I want t

problem with hasOne saving

2010-08-15 Thread Tomfox Wiranata
hi i have two models: User and Address.. the relation is User hasOne Address. In my users_controller i declare it like this: var $name = 'Users'; var $hasOne = 'UserAddress'; var $uses = array('UserAddress'); now after all information are entered in the form i am saving th

Re: Problem with hasOne and belongsTo using non-standard foreignKeys

2008-06-19 Thread Robert
My bad - stupid mistake. Thanks for help! Robert On 18 Cze, 20:18, floob <[EMAIL PROTECTED]> wrote: > Hey Robert, > You've got it a bit backwards.  If Item contains all the foreign keys, > then Item _belongsTo_ ItemType and ItemStatus.  Type and Status would > both "haveOne" Item  From the book'

Re: Problem with hasOne and belongsTo using non-standard foreignKeys

2008-06-18 Thread floob
Hey Robert, You've got it a bit backwards. If Item contains all the foreign keys, then Item _belongsTo_ ItemType and ItemStatus. Type and Status would both "haveOne" Item From the book's section on Associations : belongsTo: "foreignKey: the name of the foreign key found in the _current_ model

Problem with hasOne and belongsTo using non-standard foreignKeys

2008-06-18 Thread Robert
Hi, I tried to search through the group archive but did not find any solution. My problem is pretty simple and probably solution is also simple for all who dealt with cake relations. I have 3 database tables: items with columns: id, type, status item_types with columns: id, name item_statuses wi

problem with hasOne

2007-03-26 Thread salimk786
My problem is that every time i update my profile, it does an insert instead of an update sql command. Is my associations incorrect ? Thanks. class Member extends AppModel { var $name = 'Member'; var $hasOne = array('Profile' => array('className'

Problem with $hasOne...can somebody tell me what's wrong

2006-08-19 Thread milicic.marko
Here are my tables: DROP TABLE IF EXISTS `countries`; CREATE TABLE `countries` ( `id` int(11) unsigned NOT NULL auto_increment, `name` varchar(255) collate utf8_bin NOT NULL, `iso2` varchar(2) collate utf8_bin NOT NULL, `iso3` varchar(3) collate utf8_bin NOT NULL, PRIMARY KEY (`id`) )