Model constructor not being called

2009-02-16 Thread JoshSchramm

Hey guys.

Ive been fighting with a problem for a couple days now and it popped
back up this morning.

I have a class hotel_group_member that is a model. Some relevant info

filename: hotel_group_member.php
classname: HotelGroupMember
table: hotel_group_members

For some reason it isnt getting initialized. I get this error on my
landing page for the controller - Undefined property:
HotelGroupMember::$table [CORE/cake/libs/model/model.php, line 639]

I hunted it down a bit and in class_registry this line gets execute - $
{$class} = new $class($settings);

but it never calls __construct in model.php like every other model
does. It just kinda dies there and skips the constructor.

I dont have the constructor overridden in my class so it should be
passing through to AppModel

Any thoughts?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Model constructor not being called

2009-02-16 Thread JoshSchramm

A bit more background. I had this same issue a couple days ago and the
only way i was able to solve it was to basically rename the model. At
that time it was a model i had just created so it was no big deal to
rename, this time though I'm using this all over the place. Even more
frustrating this model worked on Friday when i went home and no one
else was working on it. No database changes... im sure something
changed somewhere but for the life of me i can't find it (nor can
SVN)



On Feb 16, 9:19 am, JoshSchramm josh.schr...@gmail.com wrote:
 Hey guys.

 Ive been fighting with a problem for a couple days now and it popped
 back up this morning.

 I have a class hotel_group_member that is a model. Some relevant info

 filename: hotel_group_member.php
 classname: HotelGroupMember
 table: hotel_group_members

 For some reason it isnt getting initialized. I get this error on my
 landing page for the controller - Undefined property:
 HotelGroupMember::$table [CORE/cake/libs/model/model.php, line 639]

 I hunted it down a bit and in class_registry this line gets execute - $
 {$class} = new $class($settings);

 but it never calls __construct in model.php like every other model
 does. It just kinda dies there and skips the constructor.

 I dont have the constructor overridden in my class so it should be
 passing through to AppModel

 Any thoughts?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Model constructor not being called

2009-02-16 Thread JoshSchramm

ok update number 2.

I dumped a list of included files and it isnt even including the file
that corresponds to this model (which explains why it cant find a
constructor). Back to digging.

On Feb 16, 9:26 am, JoshSchramm josh.schr...@gmail.com wrote:
 A bit more background. I had this same issue a couple days ago and the
 only way i was able to solve it was to basically rename the model. At
 that time it was a model i had just created so it was no big deal to
 rename, this time though I'm using this all over the place. Even more
 frustrating this model worked on Friday when i went home and no one
 else was working on it. No database changes... im sure something
 changed somewhere but for the life of me i can't find it (nor can
 SVN)

 On Feb 16, 9:19 am, JoshSchramm josh.schr...@gmail.com wrote:

  Hey guys.

  Ive been fighting with a problem for a couple days now and it popped
  back up this morning.

  I have a class hotel_group_member that is a model. Some relevant info

  filename: hotel_group_member.php
  classname: HotelGroupMember
  table: hotel_group_members

  For some reason it isnt getting initialized. I get this error on my
  landing page for the controller - Undefined property:
  HotelGroupMember::$table [CORE/cake/libs/model/model.php, line 639]

  I hunted it down a bit and in class_registry this line gets execute - $
  {$class} = new $class($settings);

  but it never calls __construct in model.php like every other model
  does. It just kinda dies there and skips the constructor.

  I dont have the constructor overridden in my class so it should be
  passing through to AppModel

  Any thoughts?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Model constructor not being called

2009-02-16 Thread mscdex

What does your model class look like?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Model constructor not being called

2009-02-16 Thread Miles J

Ive had this problem before and I never had a solution. I had to
create a fake model and set the $useTable to the table, and then it
would work.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Model constructor not being called

2009-02-16 Thread Miles J

You know what, this is happening to me right now. On some pages my
TeamsUser model works, but on others it does not and errors. When I
debug($this-TeamsUser), I expect to see the TeamsUser object, but
instead I see the AppModel object, hence I know its not loading. I
have no idea why and its halting my development.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---