Re: Selecting records that have hasmany child records.

2010-01-09 Thread John Andersen
Just for curiosity, have you tried retrieving the data from the other end of the relationship - from the Offer side? $this->Offer->find( 'all', array( 'contain' => array('Venue'), 'conditions' => array('Offer.end_date >' => $time) ) ); Use $this->Venue->Offer->find( if you are i

Re: one to many Model relations

2010-01-09 Thread John Andersen
Yes, exactly :) Using CakePHP models, the result is: Location hasMany Job Location hasMany Shop But are each Job independent of Shop? Enjoy, John On Jan 10, 1:31 am, loke wrote: > Or may be, I do not even need a reference table in the middle, because > there is a singular relationship between

Re: iPhone users: help with idea of a CakePHP plugin

2010-01-09 Thread FrederickD
Have you checked out the latest tool created by WidgetPress? It integrates iPhone app development with a CakePHP generator. Check it out at http://widgetpress.com/. I haven't used it yet, but I have used ModelBaker to good success. It might prove interesting... On Jan 9, 10:49 am, BrendonKoz w

RE: New to Cache

2010-01-09 Thread Dave
Files show up in the cache folder as default_country_cache or default_state_cache Cache::config('default', array( 'engine' => 'File', 'duration'=> '+1 hours', 'prefix' => 'default_', 'path' => CACHE )); Cache::config('short', array( 'engine' => 'File',

Re: Selecting records that have hasmany child records.

2010-01-09 Thread #2Will
Hi Everyone, thanks very much for the replies. The sub query is the only one that worked for me. I have the acts as containable statement in my app_model. I think i need to move the condition statement out of contains and into the main contains statement to limit the venue selection to venues w

Re: New to Cache

2010-01-09 Thread Pablo Viojo
Your current config has all path set to CACHE, so all the cache files will be written to the cache folder, try setting diferent 'prefix' settings so you can check which configuration is being used. Regards Pablo Viojo pvi...@gmail.com http://pviojo.net ¿Que necesitas? http://www.needish.com On

RE: New to Cache

2010-01-09 Thread Dave
I noticed that an changed it to the cookbook example: $state_cache = Cache::read('state_cache', 'short'); if ($state_cache !== false) { $state_cache = $this->getStates();

Re: New to Cache

2010-01-09 Thread Pablo Viojo
There's an error in your code: if ($state_cache !== false) should be if (empty($state_cache)) or something like that. Change it and try again. Regards Pablo Viojo pvi...@gmail.com http://pviojo.net ¿Que necesitas? http://www.needish.com On Sat, Jan 9, 2010 at 9:06 PM, Dave wrote: > Nope

RE: New to Cache

2010-01-09 Thread Dave
Nope, nothing happened. I have a folder inside cache called long and its empty. Noting saved to it. Any other ideas? $state_cache = Cache::read('state_cache', 'long'); if ($state_cache !== false) {

Re: New to Cache

2010-01-09 Thread Pablo Viojo
Try passing the config as third param when writing and second when reading: Cache::write('state_cache', $state_cache, 'long'); Cache::read('state_cache', 'long'); HTH! Regards, Pablo Viojo pvi...@gmail.com http://pviojo.net ¿Que necesitas? http://www.needish.com On Sat, Jan 9, 2010 at 8:20

Re: one to many Model relations

2010-01-09 Thread loke
Or may be, I do not even need a reference table in the middle, because there is a singular relationship between each pair of models. So storing the id of the location in each table should be enough to refer to the correct location. It is a many-to-one relationship. Thanks Loke On Jan 9, 6:27 pm,

Re: one to many Model relations

2010-01-09 Thread loke
Well, the situation is like this: Locations(id, location_info) is an independent table to store all relevant locations. Jobs (id, name, location_id) is a table that has exactly one location for each job, and stores the location_id from location(id). Shops(id, name, location_id) is another table tha

New to Cache

2010-01-09 Thread Dave
This is my first attempt at caching a model find() and was hoping for a little info. Cache::write('state_cache', $state_cache); So I check server cache folder and see a file called cake_state_cache which contains: 1263079575 {i:15;s:7:"Alabama";i:14;s:6:"Alaska";i:17;s:7:"Arizona";i:16;s:8:"Ark

how to setup 3 distinct Layouts: Public / UserLoggedIn / AdminLoggedin ?

2010-01-09 Thread kyle
Im new to cakephp but I love the concept thus far. I understand how to create views and change the default layout but its unclear to me how to make different layouts with different images and css. My question is... I want to build an application that is designed like the following... LAYOUT1: (pu

Re: How to retrieve the URL being accessed

2010-01-09 Thread Pedro Nascimento
Yeah, you can check Auth->allow and deny methods. They're great. On Sat, Jan 9, 2010 at 00:43, euromark wrote: > take a lock at > $this->params > > you can do that with > pr() which prints out the array as long as you are in debug mode > > there is > - controller: $this->params['controller'] > -

Re: iPhone users: help with idea of a CakePHP plugin

2010-01-09 Thread BrendonKoz
Yes, that is correct. I suppose it can easily be likened to a text message, except there's no fee associated with it (other than the immediate and upfront purchase of the application to run on the phone). There are 3 fields that (can) get sent to the device: Application Name, Event, and Descripti

Update view when new record is inserted in a specific table

2010-01-09 Thread Ricardo Canastro
I'm doing an auctions website (not for any institution, just as part of my learning of php and cakephp). At Home page I have all the items displayed. What I need to do now is to refresh price / last licitation and time remaining in each item when any user makes a licitation. So do you know how can

Integration of AjaxChat in Cake?

2010-01-09 Thread euromark
Did anyone try to integrate AJAX Chat - on open source chat application - into an exisiting cake project? like a community site or a forum? i found out that there are several custom chat mods available for it (like phpBB etc), but i coudn't quite figure out how to configure for cake settings (sess