Re: Database scheme question...

2012-09-16 Thread Jeremy Burns : Class Outfit
That would do it. Then you need to set up your model associations. public $hasOne = array( 'Manager' = array( 'className'= 'User', 'foreignKey' = 'manager_user_id' ), 'Contact' = array( 'className'= 'User',

Re: Error rendering, is it the intended functionality?

2012-09-16 Thread Mohammad Naghavi
Hi, I do no query from inside the View, I just call this: $this-Form-create(); inside my view. the problem is that every thing inside view before this line comes as a part of the exception handling output. what I think is that because I don't call any db or model related actions inside the

Re: How do i validate multiple fields using the same field name?

2012-09-16 Thread resting
Created a test setup with v2.2.0 Validation doesn't work. Empty fields still pass. What am I doing wrong here? Full source: https://github.com/resting/cakephp/blob/test_validation/app/Controller/MyFormController.php On Friday, 14 September 2012 15:42:36 UTC+8, resting wrote: I have

How to implement the Remember Me with Auth?

2012-09-16 Thread tomtom
Hello, I have successfully used Auth, but unfortunately, it seems that it does work only with Session. I want that if user check Remember Me checkbox, I would use Cookie and he would be logged in for 2 weeks. I can't find anything in official book and in Google I found just few and not great

Re: Error rendering, is it the intended functionality?

2012-09-16 Thread Léo Willian Kölln
Why there is some DB interaction during the View rendering? You dont need to do any query explicitly on the View file, if you are calling a method that does some DB interaction you are doing a Query during the View Context. If you need some data that comes from model (doesn't matter if it is from

Re: How do i validate multiple fields using the same field name?

2012-09-16 Thread euromark
have you ever seen validates() taking arguments? especially $data? nope $this-Model-set($this-request-data) $result = $this-Model-validates() as the book describes Am Sonntag, 16. September 2012 20:09:24 UTC+2 schrieb resting: Created a test setup with v2.2.0 Validation doesn't work.

Re: How to implement the Remember Me with Auth?

2012-09-16 Thread euromark
http://www.dereuromark.de/2012/02/02/more-persistent-sessions-in-cake2-x/ is one easy way (only adding the component). but since 2.x there is also some CookieAuth (i never tried before, though): https://github.com/ceeram/Authenticate/blob/master/Controller/Component/Auth/CookieAuthenticate.php

Re: Find method with multiple tables

2012-09-16 Thread Mike Griffin
Code, code, code, code, code. Show what you have tried. And saying something is urgent (has everything you posted been urgent?) won't help in most cases. -- Mike Griffin Sent with Sparrow (http://www.sparrowmailapp.com/?sig) On Sunday 16 September 2012 at 05:09, Mr. Manager wrote: Dear

Re: Find method with multiple tables

2012-09-16 Thread Ly Dara
Dear All, Now I can solve it by using query function instead of find and use my sql query language instead of cakephp language syntax. However, I will post my code later because I still want to find out to use cakephp syntax with complex find condition. Thanks a lot for your taking time to

Cake 2.2 Can't save/update database

2012-09-16 Thread d6games
The following code in my PlayersController doesn't error but also doesn't save anything to the database table... private function authorize($tag, $pass) { $findPlayer = $this-Player-find('first', array( 'conditions' = array('Tag' = $tag, 'Password' = $pass) ));

hasMany through - how to retrieve my data?

2012-09-16 Thread Nvp
Hi! I built DB with tables: *restaurants* - main table *kitchens* - second table *kitchen_restaurants* - join table with fields: id, kitchen_id, restaurant_id *Model/Restaurant.php*: public $hasMany = array( 'KitchenRestaurant' ); *Model/Kitchen.php*: public $hasMany = array(

Re: How do i validate multiple fields using the same field name?

2012-09-16 Thread resting
Hi yes, realized my mistake. Have made the changes https://github.com/resting/cakephp/commit/ce2ffa4300f59720566a85db0b5ced5d4b96a117 But the result is still the same...weird... On Monday, 17 September 2012 03:40:36 UTC+8, euromark wrote: have you ever seen validates() taking arguments?

Re: hasMany through - how to retrieve my data?

2012-09-16 Thread Jonathan Sundquist
Why are you using a hasMany instead of a hasAndBelongsToMany? You wouldn't need the id column as you two ideas together would be your index. - The cold winds are rising On Sep 16, 2012 5:17 PM, Nvp leh...@gmail.com wrote: Hi! I built DB with tables: *restaurants* - main table *kitchens* -

Re: Cakephp, gearman workers and changing database connection on the fly issue

2012-09-16 Thread Dr. Tarique Sani
On Sat, Sep 15, 2012 at 6:46 PM, Ketan Shah ketan.s...@gmail.com wrote: Thats correct. I am sending the db config info in the workload Paste the code that you are using to change the DB This should not happen because every workload is processed in its own thread and they do not share anything.

Re: Cakephp, gearman workers and changing database connection on the fly issue

2012-09-16 Thread Ketan Shah
Thanks Tarique, Here you go. http://pastebin.com/ezCBqyGV On Mon, Sep 17, 2012 at 10:10 AM, Dr. Tarique Sani tariques...@gmail.comwrote: On Sat, Sep 15, 2012 at 6:46 PM, Ketan Shah ketan.s...@gmail.com wrote: Thats correct. I am sending the db config info in the workload Paste the code

Re: How do i validate multiple fields using the same field name?

2012-09-16 Thread resting
Ok, finally able to get it to work. The results if anyone is interested. https://github.com/resting/cakephp/commits/test_validation On Monday, 17 September 2012 10:29:07 UTC+8, resting wrote: Hi yes, realized my mistake. Have made the changes