find in the presence of HABTM

2010-01-02 Thread Lorenzo Bettini
Hi I have Paper and Author in HABTM relation (AuthorsPaper is the join table model). If I try to perform a find on the Paper model which involves also the authors in the condition I get an error since only the papers table is used for the conditions (even though recursive is set to 1). Thus,

Re: find method fetching all ids in single query

2010-01-02 Thread j0n4s.h4rtm...@googlemail.com
debug($this-Model-find('count', array('conditions' = array ('Model.id' = $arrayOfIds; On Jan 1, 4:32 pm, engine radicalet...@gmail.com wrote: yeah thanks, this method is the same i found after few hours posting this question mike karthauser wrote: On 1 Jan 2010, at 12:56, engine

How to add a column to the table after it is baked.

2010-01-02 Thread Robin Thomas
I created a table and baked it. Everything was working fine. After that I added one more column to the table. and modified the .ctp file(for add) to include the new column. But when I save a new entry , the new column is not getting saved. How can I add a column to the table after it is

Re: How to add a column to the table after it is baked.

2010-01-02 Thread Jeremy Burns
The first place to start is by setting the debug level. In app/config/ core.php find the line that looks like this: Configure::write('debug', 2); ...and ensure the number is 1 or higher (2 is good). Then visit your view again. When the debug level is 1 or higher, Cake refreshes its model cache.

Inheritable classes? Best Method

2010-01-02 Thread Travis
I have been researching inheritable classes for a program I am working on in cake. I need to keep a log of events that fall under 4 different types of events. The idea is to have one table that stores the event date and the common information then foreign key to the appropriate table of events.

redirect from within a view

2010-01-02 Thread Lorenzo Bettini
Hi is there a way to perform a redirect from inside a view? For instance if the user is not logged. I can do this manually like this: ?php if (!$session-check('User')) { header (Location: .$html-url('/')); } ? but I was wondering if there was a more cake way to do this. thanks in

Re: redirect from within a view

2010-01-02 Thread John Andersen
Make the check in the controller and do the redirect from there! Enjoy, John On Jan 2, 7:01 pm, Lorenzo Bettini bett...@dsi.unifi.it wrote: Hi is there a way to perform a redirect from inside a view? For instance if the user is not logged. I can do this manually like this: ?php if

Re: How to add a column to the table after it is baked.

2010-01-02 Thread Dave
Make sure you use the form helper. I would guess if you inspect the html you will see that your new field's name doesn't match the other fields. On Sat, Jan 2, 2010 at 9:58 AM, Jeremy Burns jeremybu...@me.com wrote: The first place to start is by setting the debug level. In app/config/

Re: How to implement Comet in CakePHP ?

2010-01-02 Thread nacho4d
Hey.. Its been a while. As I said before I want to implement comet chat system in cakePHP, (there was a plug-in around there, but it does not seems to work fine anymore. not for 1.2) So, I have my controller: cometchats_controller.php and my action function comet(){ //get database data and pass

Easy Sort Function

2010-01-02 Thread Dave
I was wondering what would be the easiest way to sort (thru pagination) tickets based on a value in the ticket. My tickets have a value in the table of 0,1,2, or 3 based on priority So on the index page need 4 links then if clicked will pull all tickets based on the priority value. Url would

Re: How to implement Comet in CakePHP ?

2010-01-02 Thread Pablo Viojo
Forget Comet. Take a look at Jabber (A very good server http://www.igniterealtime.org/projects/openfire/) and JsJac http://blog.jwchat.org/jsjac/ if you want to write a robust chat system. (It will save a lot of time) Regards, Pablo Viojo pvi...@gmail.com http://pviojo.net ¿Que necesitas?

behaviors conflicting

2010-01-02 Thread Foroct
I am using two common behaviors in my cakePHP project, Sluggable (http://bakery.cakephp.org/articles/view/sluggable-behavior) and Searchable (http://code.google.com/p/searchable-behaviour-for- cakephp/). Both of these work fine by themselves but when I try to use them both in a model by calling

Dutch CakePHP meetup

2010-01-02 Thread Primeminister
Finally! The dutch CakePHP meetup number 1 also know as Dutch Borrel. It will be on Tuesday Jan 12th. 2010 in Amsterdam. To get to know eachother we’re not only talk and drink. We are gonna really meet eachother… through code. Dutch Borrel #1: Show-your-Code Meetup Amsterdam For more

Selecting records that have hasmany child records.

2010-01-02 Thread #2Will
I'm using cake 1.2. I have a table of venues (Venue model) that hasmany offers (Offer model). var $hasMany = array( 'Offer' = array( 'className' = 'Offer', 'foreignKey' = 'venue_id', ...etc How can i only select venues that have

Problem with app_controller.php

2010-01-02 Thread szusty
Hi all. I have a problem with app_controller i CakePHP. The files in folder controller don't see a function in file app_controller.php and I don't now why. When I start program I see white side. Please help me. ;] Check out the new CakePHP Questions site http://cakeqs.org and help others with

Re: How to implement Comet in CakePHP ?

2010-01-02 Thread nacho4d
I know there are much better approaches than comet, but how about comet in cakePHP? I am correct so far with above pseudo-code (or algorithm)?? On Jan 3, 4:26 am, Pablo Viojo pvi...@gmail.com wrote: Forget Comet. Take a look at Jabber (A very good

Re: Secret URLs

2010-01-02 Thread Walther
Not really possible afaik. But, security through obscurity is not the solution. You should rather spend the time writing code that will make sure that the user/referer has permissions to perform that action. On Jan 1, 9:54 pm, anka andreas.katz...@gmail.com wrote: Hi @all, I have a (almost)

Re: Problem with app_controller.php

2010-01-02 Thread John Andersen
Please show the code in the app_controller and the code in another controller that are supposed to use the code in the app_controller, then we may better be able to assist you :) Enjoy, John On Jan 2, 9:17 pm, szusty szustak.tom...@gmail.com wrote: Hi all. I have a problem with