Re: Accessor like command in CakePHP

2007-03-23 Thread Justin Hernandez
Thanks for the further info. On Mar 22, 10:29 am, "GreyCells" <[EMAIL PROTECTED]> wrote: > If I understand you correctly, you'd like to add model attributes that > can be used by the model internally (for validation etc), but not > persisted to the database? > > All model data is stored as an ass

Re: Accessor like command in CakePHP

2007-03-22 Thread GreyCells
If I understand you correctly, you'd like to add model attributes that can be used by the model internally (for validation etc), but not persisted to the database? All model data is stored as an associative array (a public attribute) in the model as $this->data['ModelName']['field_name'], so you

Re: Accessor like command in CakePHP

2007-03-22 Thread Justin Hernandez
Again thanks for the replies. CakePHP is making fine progress. I look forward to 2.0. Anyway I think I'm just gonna take the fast way out and create an extra column. It's not so bad because the table will be trashed every 24 hours. On Mar 21, 9:52 pm, "Justin Hernandez" <[EMAIL PROTECTED]> wrote:

Re: Accessor like command in CakePHP

2007-03-21 Thread Justin Hernandez
Thanks man. On Mar 21, 9:45 pm, "themanfrombucharest" <[EMAIL PROTECTED]> wrote: > Hey Justin, > > In reply to your first question, no, there isn't anything like that in > cake yet. > > So if you want accessors/mutators you have to write the functions > yourself. The main reason for this is becau

Re: Accessor like command in CakePHP

2007-03-21 Thread themanfrombucharest
Hey Justin, In reply to your first question, no, there isn't anything like that in cake yet. So if you want accessors/mutators you have to write the functions yourself. The main reason for this is because the ORM layer in cake isn't fully object oriented yet (I understand it's planned for 2.0).

Re: Accessor like command in CakePHP

2007-03-21 Thread Justin Hernandez
Thanks for the reply Grant. My problem is that I have a 'check here to accept' checkbox on my form. I want to associate it with my current model even though there is no corresponding column in the table. Because there is no column I get an incorrect index error in php. In rails if you use attr_a

Re: Accessor like command in CakePHP

2007-03-21 Thread Grant Cox
I don't know what the att_accessor is in RoR. Perhaps what you want is the afterFind callback, where you can modify the data loaded from the db (including adding extra attributes). Justin Hernandez wrote: > How can I add variables to a model without having a corresponding > field in the table?

Accessor like command in CakePHP

2007-03-20 Thread Justin Hernandez
How can I add variables to a model without having a corresponding field in the table? I'm looking for something like the attr_accessor in RoR. Thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" grou