Re: Problem with model inheritance

2007-11-21 Thread kgrimm

I'm inheriting from my own model class which itself is inherited from
AppModel.

Adding a require statement doesn't work (Cannot redeclare class ...).
With the inheritance itself everything works fine, the problem lies in
the Cake function loadModels() in basics.php.


On Nov 20, 8:04 pm, francky06l [EMAIL PROTECTED] wrote:
 What do you mean by inheritance ? I mean inheriting from a cake core
 class (ie : Appmodel etc ..) or one of your own class ?
 If it's you own class, you need a require statement before your class
 declaration, then it should not be a problem.

 Sorry if I misunderstood the problem

 On Nov 20, 5:57 pm, kgrimm [EMAIL PROTECTED] wrote:

  Hi,

  I'm using inheritance for my own models and controllers. On my local
  machine everything works fine.

  When installing in another environment (from SVN or a tar archive for
  example) I have the problem, that the model classes are not loaded in
  the same order, so it happens that a child class is loaded before its
  parent which leads to error messages. It seems they are loaded in
  alphabetical order, which is not the case locally.

  Does anybody have an idea for a clean solution without for example
  adding absolute paths in cake's code?
  Isn't it just usual to use inheritance for your own models? Why
  doesn't Cake check for it?

  I'm using Cake 1.1.8.3544

  Thanks in advance!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Problem with model inheritance

2007-11-21 Thread francky06l

I had this problem a while ago, and I have seen a correction about
this in loadModels(). This was failing because of the parent class
that was expected to be appModel.
Maybe this has changed, I haven't tried this application for few
month.. I will check

On Nov 21, 9:15 am, kgrimm [EMAIL PROTECTED] wrote:
 I'm inheriting from my own model class which itself is inherited from
 AppModel.

 Adding a require statement doesn't work (Cannot redeclare class ...).
 With the inheritance itself everything works fine, the problem lies in
 the Cake function loadModels() in basics.php.

 On Nov 20, 8:04 pm, francky06l [EMAIL PROTECTED] wrote:

  What do you mean by inheritance ? I mean inheriting from a cake core
  class (ie : Appmodel etc ..) or one of your own class ?
  If it's you own class, you need a require statement before your class
  declaration, then it should not be a problem.

  Sorry if I misunderstood the problem

  On Nov 20, 5:57 pm, kgrimm [EMAIL PROTECTED] wrote:

   Hi,

   I'm using inheritance for my own models and controllers. On my local
   machine everything works fine.

   When installing in another environment (from SVN or a tar archive for
   example) I have the problem, that the model classes are not loaded in
   the same order, so it happens that a child class is loaded before its
   parent which leads to error messages. It seems they are loaded in
   alphabetical order, which is not the case locally.

   Does anybody have an idea for a clean solution without for example
   adding absolute paths in cake's code?
   Isn't it just usual to use inheritance for your own models? Why
   doesn't Cake check for it?

   I'm using Cake 1.1.8.3544

   Thanks in advance!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Problem with model inheritance

2007-11-21 Thread kgrimm

I have solved the problem now by putting the derivated model classes
in subdirectories, letting the loadModels() function load first the
models of the current directory, then of subdirectories.

On Nov 21, 9:56 am, francky06l [EMAIL PROTECTED] wrote:
 I had this problem a while ago, and I have seen a correction about
 this in loadModels(). This was failing because of the parent class
 that was expected to be appModel.
 Maybe this has changed, I haven't tried this application for few
 month.. I will check

 On Nov 21, 9:15 am, kgrimm [EMAIL PROTECTED] wrote:

  I'm inheriting from my own model class which itself is inherited from
  AppModel.

  Adding a require statement doesn't work (Cannot redeclare class ...).
  With the inheritance itself everything works fine, the problem lies in
  the Cake function loadModels() in basics.php.

  On Nov 20, 8:04 pm, francky06l [EMAIL PROTECTED] wrote:

   What do you mean by inheritance ? I mean inheriting from a cake core
   class (ie : Appmodel etc ..) or one of your own class ?
   If it's you own class, you need a require statement before your class
   declaration, then it should not be a problem.

   Sorry if I misunderstood the problem

   On Nov 20, 5:57 pm, kgrimm [EMAIL PROTECTED] wrote:

Hi,

I'm using inheritance for my own models and controllers. On my local
machine everything works fine.

When installing in another environment (from SVN or a tar archive for
example) I have the problem, that the model classes are not loaded in
the same order, so it happens that a child class is loaded before its
parent which leads to error messages. It seems they are loaded in
alphabetical order, which is not the case locally.

Does anybody have an idea for a clean solution without for example
adding absolute paths in cake's code?
Isn't it just usual to use inheritance for your own models? Why
doesn't Cake check for it?

I'm using Cake 1.1.8.3544

Thanks in advance!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Problem with model inheritance

2007-11-20 Thread kgrimm

Hi,

I'm using inheritance for my own models and controllers. On my local
machine everything works fine.

When installing in another environment (from SVN or a tar archive for
example) I have the problem, that the model classes are not loaded in
the same order, so it happens that a child class is loaded before its
parent which leads to error messages. It seems they are loaded in
alphabetical order, which is not the case locally.

Does anybody have an idea for a clean solution without for example
adding absolute paths in cake's code?
Isn't it just usual to use inheritance for your own models? Why
doesn't Cake check for it?

I'm using Cake 1.1.8.3544

Thanks in advance!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Problem with model inheritance

2007-11-20 Thread francky06l

What do you mean by inheritance ? I mean inheriting from a cake core
class (ie : Appmodel etc ..) or one of your own class ?
If it's you own class, you need a require statement before your class
declaration, then it should not be a problem.

Sorry if I misunderstood the problem

On Nov 20, 5:57 pm, kgrimm [EMAIL PROTECTED] wrote:
 Hi,

 I'm using inheritance for my own models and controllers. On my local
 machine everything works fine.

 When installing in another environment (from SVN or a tar archive for
 example) I have the problem, that the model classes are not loaded in
 the same order, so it happens that a child class is loaded before its
 parent which leads to error messages. It seems they are loaded in
 alphabetical order, which is not the case locally.

 Does anybody have an idea for a clean solution without for example
 adding absolute paths in cake's code?
 Isn't it just usual to use inheritance for your own models? Why
 doesn't Cake check for it?

 I'm using Cake 1.1.8.3544

 Thanks in advance!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---