Re: Handling Timezones in cakephp

2011-10-17 Thread David Kullmann
Sorry for emailing you directly - I meant to reply on this forum but hit the wrong button. You should follow these rules: 1. All times in the database should always be UTC 2. beforeSave and afterFind you should always convert the times to the users time zone 3. You should never have a time whic

Re: How to create mock object from a Model's Behavior?

2011-08-19 Thread David Kullmann
Kevin: I haven't written a lot of Model / Behavior tests, however, I believe that you might want to test your model with the behavior enabled. You can also write tests of *just* a behavior by itself. Regards, David On Aug 18, 9:10 am, David Kullmann wrote: > You could they creating

Re: How to create mock object from a Model's Behavior?

2011-08-18 Thread David Kullmann
You could they creating it with the same process to create any mock object and then attaching it with "$Model->Behaviors->attach()" On Aug 16, 11:53 pm, Ken Vu wrote: > Is it even possible? -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new C

Re: CakePHP Modified and Created GMT Time

2011-07-31 Thread David Kullmann
Ecommy: You could still have the actual server timezone be different, and just have the PHP timezone be UTC. You probably don't want to have the timezone determined on the PHP-level for your application anyway, you want your application to determine the timezone instead. -DK On Jul 30, 4:50 am,

Re: CakePHP Modified and Created GMT Time

2011-07-31 Thread David Kullmann
You could write a behavior for GMT-ifying the timestamps in beforeSave. On Jul 30, 4:50 am, ecommy wrote: > not necesary true in my case, I need to change the timezone depending on > country but still keep the time in the database inGMT > > what is your aproach in this case? There are several sol

Re: SQL error 1064 in a hasMany through relationship

2011-07-16 Thread David Kullmann
Diogo: Notice how in your trace it shows this: Model::call__() - CORE/cake/libs/model/model.php, line 502 Looking at the Model::call__() method you can see that it is designed to handle custom function calls: "Handles custom method calls, like findBy for DB models" Your model does not have

Re: Recursive pagination

2011-06-09 Thread David Kullmann
Thomaus: Can you show us some of your code? I think the Tilen's solution is correct and you can see the PaginatorHelper::sort() method defined here: http://api.cakephp.org/view_source/paginator-helper/#line-293 and I don't think the depth of the search affects it's output. -DK On Jun 9, 9:28 a

Re: new controller/model/view problem.

2011-06-05 Thread David Kullmann
Sounds like AuthComponent is redirecting you. If you don't require a user to be logged in for the controller you added then add $this->Auth- >allow() to beforeFilter() in the new controller (check book.cakephp.org for details) On Jun 5, 8:05 pm, Alida wrote: > Hi, > > Im new to cakephp and a bake

Re: robots.txt

2011-05-20 Thread David Kullmann
I believe it depends on your .htaccess file as well. I have this: RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule(.*) app/webroot/$1 [L] To check for a file or directory. My DocumentRoot is the directory which contains APP: ls -1d app/ flash/ ap

Re: Caching

2011-04-11 Thread David Kullmann
Jeremy: You can refresh caches after a model is saved, just add that into your code. Regarding searching, I don't know if it meets your specific goal but there are lots of pre-built searching applications that will index everything for you and refresh their own caches. Maybe it's easier to use on

Re: having trouble with post on inherited cake project

2011-02-20 Thread David Kullmann
Thomas: I think 2 responses ago Cricket gave the best answer so far. Check out this page on the CakePHP docs that shows how to create an input with the "[]" modifier to the form name: http://book.cakephp.org/view/1395/options-multiple I know it can be frustrating inheriting a project and we have

Re: Nick Baker's FileUpload inside a plugin

2011-01-29 Thread David Kullmann
Anton: Can you explain which features aren't working? You could also use the cake pastebin to show us some of the code so we can take a look. Thanks, DK On Jan 28, 4:46 pm, Anton wrote: > Hi i have been trying out Nick Bakers FileUpload plugin and its got > some great features and worked straig

Re: What are your personal conventions for Helper names and using helper classes?

2011-01-22 Thread David Kullmann
Connrs: It is best practice to use $this->Helper and I believe you may run into some issues if you don't do it with some helpers in Cake1.3.x. -DK On Jan 21, 9:53 am, connrs wrote: > Hi guys > > I suppose this is my first ever post on any CakePHP related forum/group so > get the unicorns and ba