irfan baig wrote:
> > Why not just put if (!class_exists('Vehicle'))
> > {require("Vehicle.php");} at the top of your scooter and car model
> > files?
>
> Won't work - the issue occurs even before that in basics.php, when
> loading the models
Ok continuing in the same theme..

Your vehicle model:
<?php
if (!class_exists('Vehicle')) {
        class Vehicle extends AppModel
        {
            var $name = "Vehicle";
        }
}
?>

Your sub vehicle models:
<?php
if (!class_exists('Vehicle')) {require("Vehicle.php");}
class Scooter extends Vehicle
{
    var $name = "Scooter";
}
?>

There may be a tidier way of doing it, but that'll work. If Vehicle is
an abstract class that you won't be instantiating you could just put it
in your app folder, and therefore bypass any problems caused by
loadModels.

HTH,

AD7six


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~----------~----~----~----~------~----~------~--~---

Reply via email to