I need to build a dual sided / role related site so there are 2 types of
Users (Buyer and Seller) so upon registration User will select who they are
and based on that create the User. 

They can only be one or the other. 

So when logged in as Buyer the can access the buyer end of the site, same as
Seller.

 

But the issues I see come because the Seller / Buyer have different
relations to other models. Is it better off to create the Buyer / Seller as
separate MVC objects?

 

Something like this for User model?

 

                public $belongsTo = array(

                                'Role' => array(

                                                'className' => 'Role',

                                                'foreignKey' => 'role_id',

                                                'conditions' => '',

                                                'fields' => '',

                                                'order' => ''

                                )

                );

 

                public $hasOne = array(

                                'Buyer' => array(

                                                'className' => 'Buyer',

                                                'foreignKey' => 'user_id',

                                ),

                                'Seller' => array(

                                                'className' => 'Seller',

                                                'foreignKey' => 'user_id',

                                )

                );

                

                

Open to the hearing best solution to this issue from the community.

 

Thanks.

-- 
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].
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.


Reply via email to