Hi all,

I have a problem with using scaffold on a model called 'Model'. I
can't seem to find an answer in the groups...
All the other models in my app work correctly under scaffolding,
except the 'Model' model which does not join with the 'HardwareType'
or 'HardDrive' models like it is supposed to and so I don't get drop
down boxes.

Models included below. Does anyone have an idea? Can I not call the
model, 'Model'? Maybe I'm missing something?

Thanks

Austen

<?php

class Chassis extends AppModel
{
        var $name = 'Chassis';

        var $displayField = 'model';

        var $hasMany = array('HardwareRevision' => array('className' =>
'HardwareRevision'),'Unit' => array('className' => 'Unit'));
        var $belongsTo = 'Manufacturer';
}
?>
<?php

class Group extends AppModel
{
        var $name = 'Group';

        var $displayField = 'name';

        var $hasMany = 'User';
}

?>
<?php

class HardDrive extends AppModel
{
        var $name = 'HardDrive';

        var $displayField = 'size';

        var $hasMany = array('Unit' => array( 'className' => 'Unit'), 'Model'
=> array( 'className' => 'Model') );
        var $belongsTo = 'Manufacturer';
}
?>
<?php

class HardwareRevision extends AppModel
{
        var $name = 'HardwareRevision';

        var $displayField = 'description';

        var $hasMany = 'Unit';

        var $belongsTo = array(
                        'SoundBoard' => array('className' => 'SoundBoard'),
                        'Chassis' => array('className' => 'Chassis'),
                        'RamSize' => array('className' => 'RamSize'),
                        'Motherboard' => array('className' => ''),
                        'HardwareType' => array('className' => '')
                );
}
?>
<?php

class HardwareType extends AppModel
{
        var $name = 'HardwareType';

        var $displayField = 'description';

        var $hasMany = array('HardwareRevision' => array( 'className' =>
'HardwareRevision' ),
                                'Model' => array( 'className' => 'Model' ) );
}
?>
<?php

class Manufacturer extends AppModel
{
        var $name = 'Manufacturer';

        var $displayField = 'name';

        var $hasMany =
array('HardDrive','SoundBoard','Chassis','Motherboard');
}
?>
<?php

class Model extends AppModel
{
        var $name = 'Model';

        var $displayField = 'model';

        var $hasMany = 'Unit';

        var $belongsTo = array( 'HardwareType' => array( 'className' =>
'HardwareType' ),
                                'HardDrive' => array( 'className' => 
'HardDrive' ) );
}
?>
<?php

class Motherboard extends AppModel
{
        var $name = 'Motherboard';

        var $displayField = 'model';

        var $hasMany = array('HardwareRevision' => array( 'className' =>
'HardwareRevision' ),
                                'Unit' => array('className' => 'Unit'));
        var $belongsTo = 'Manufacturer';
}
?>
<?php

class RamSize extends AppModel
{
        var $name = 'RamSize';

        var $displayField = 'size';

        var $hasMany = array('HardwareRevision' => array( 'className' =>
'HardwareRevision' ),
                                                'Unit' => array('className' =>
'Unit'));
}
?>
<?php

class SoundBoard extends AppModel
{
        var $name = 'SoundBoard';

        var $displayField = 'model';

        var $hasMany = array('HardwareRevision' => array( 'className' =>
'HardwareRevision'),'Unit' => array( 'className' =>
'HardwareRevision'));
        var $belongsTo = 'Manufacturer';
}
?>
<?php

class Supplier extends AppModel
{
        var $name = 'Supplier';

        var $displayField = 'name';

        var $hasMany = 'Unit';

}
?>
<?php

class Unit extends AppModel
{
        var $name = 'Unit';

        var $displayField = 'serial_number';

        var $belongsTo = array( 'HardwareRevision' => array('className' =>
'HardwareRevision'),
                                'HardDrive' => array('className' => 
'HardDrive'),
                                'Supplier' => array('className' => 'Supplier'),
                                'Model' => array('className' => 'Model'),
                                'SoundBoard' => array('className' => 
'SoundBoard'),
                                'Chassis' => array('className' => 'Chassis'),
                                'RamSize' => array('className' => 'RamSize'),
                                'Motherboard' => array('className' => 
'Motherboard')
                        );

        var $validate = array(
                'hardware_revision_id' => VALID_NUMBER,
                'internal_zones' => VALID_NUMBER,
                'hard_drive_id' => VALID_NUMBER,
                'job_reference' => VALID_NOT_EMPTY,
                'suppliers_serial_number' => VALID_NOT_EMPTY,
                'unit_number' => VALID_NUMBER,
                'supplier_id' => VALID_NUMBER,
                'serial_number' => VALID_NUMBER,
                'model_id' => VALID_NUMBER,
                'sound_board_id' => VALID_NUMBER,
                'chassis_id' => VALID_NUMBER,
                'ram_size_id' => VALID_NUMBER,
                'motherboard_id' => VALID_NUMBER
        );

}
?>
<?php

class User extends AppModel
{
        var $name = 'User';

        var $displayField = 'username';

        var $belongsTo = 'Group';
}

?>


--~--~---------~--~----~------------~-------~--~----~
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?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to