I am using "hasMany" Relationship with cakephp.

I have relationship like

Tender=>hasMany=>TenderDocuments

with this kind of relationship.

I am at "http://localhost/cakephp/index.php/tenders/add";
Now i click "New Tender Document" and goto
http://localhost/projects/cakephp/index.php/tender_documents/add

What I want is that there should be either no display of tender combo
as i want it to be directly associated with the tender from where the
Tender that I am currently adding.

How to achive the same?

This is a kind of one-to-many relationship

Thanks in advance

CSJakharia


My Code is like this

class Tender extends AppModel
        {
                var $name='Tender';
                var $hasMany=array('TenderDocument'=>array(
                        'className'=>'TenderDocument',
                        //'conditions' => array('Tender.id = 
TenderDocument.tender_id'),
                        'order'=>null,
                        'foreignKey'=>'tender_id',
                        'exclusive'=>false,
                        'dependent'=>true
                ));
        }


<?php
        class TenderDocument extends AppModel
        {
                var $name='TenderDocument';
                var $belongsTo=array('Tender'=>array(
                        'className'=>'Tender',
                        'conditions'=>null,
                        'order'=>null,
                        'foreignKey'=>'tender_id'
                ));
        }
?>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" 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