Re: Ouch, how to have a Class model?
not 100% sure but probably you could do something like :
my_class.php
class MyClass extends AppModel {
public $useTable = 'classes';
}
or rename the database table...
Andras Kende
On Jan 6, 2012, at 8:48 PM, Arnold wrote:
> I was trying to create a model for my table classes, I created it
> using cake bake.
>
> class Class extends AppModel {
>
> That is not valid in php. Class is a reserved word.
>
> What is the right way to define it?
>
> This will work?
>
> class ClassModel extends AppModel {
> public $name = "Class";
>
> and if that works, how i should call in the rellationships? for
> example: hasMany => Class ?
>
> --
> Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home