IMO: You're creating a world of hurt for yourself by not having a
seperate table, model, conrtoller etc. for News, Events, Bookings as
they will all have their own fields and logic required.  Stick to the
conventions, there are so many good reasons why they eist.

HTH, Paul
@phpMagpie

On Sep 2, 12:24 pm, Teddy Zeenny <teddyzee...@gmail.com> wrote:
> You can set: var $uses=array('ModelName') in each of the controllers.
>
> But just my opinion:
>
> Don't name the table "objects" because your model name would be Object which
> is a class that already exists in CakePHP.
>
> Second, why link multiple controllers to one model. Instead, link multiple
> models to one table.  Then you would have EventsController which
> automatically links to Event model which uses table 'objects'.  News
> automatically links to New Model which in turn uses 'objects' table.. etc
>
> Then in the Event model for example you could have:
>
> var $useTable='objects';
>
> function beforeFind($queryData)
> {
>   return Set::merge($queryData ,
> array('conditions'=>array('Event.item_type'=>'event')));
>
> }
>
> I'm just brainstorming ... :) Just let me know what you think...
>
>
>
>
>
>
>
> On Thu, Sep 1, 2011 at 7:51 AM, Heshanh <hesh...@gmail.com> wrote:
> > I have a table called 'objects' and each record has an item_type.
> > for example :
> > row 1:
> > id = 1
> > item_type = event
>
> > row 2:
> > id =2
> > item_type = news
>
> > row 3:
> > id =3
> > item_type = booking
>
> > I have a model for the table but is it possible to have multiple
> > controllers accessing this model,
> > I want to have an events controller that will handle all the events,
> > news controller that will handle all the news... and so on
>
> > is this possible for cakePhp?
>
> > --
> > Our newest site for the community: CakePHP Video Tutorials
> >http://tv.cakephp.org
> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help
> > others with their CakePHP related questions.
>
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com For more options, visit this group
> > athttp://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to