Hi,

My question is below, but first some info about the situation I'm in:

I am taking an app that I wrote years ago for scheduling people in
different areas of work at our Center, and re-writing it in cakePHP.
In the mean time, I'm doing all sorts of things better than ever
before ;)

Among many other details, there are areas, people, shifts, etc. and
the whole configuration (what people are scheduled for what shifts and
at what time) is called a schedule. The person writing the schedule
has a lot of work to do as people come in and out, and there was the
necessity for a staging area. The way I did this in the old app, was
to have two totally separate databases called scheduler_staging, and
scheduler_public. This way, when the scheduler logged in, they would
be editing the scheduler_staging database, and then when the schedule
was ready, they could publish it, which would copy scheduler_staging
to scheduler_public. I wanted to keep a record of all old publishes,
so I added a table in scheduler_public called schedules and added a
foreign key schedule_id to all other tables. So, when a schedule got
published, it all of the data would be copied from scheduler_staging
to scheduler_public, but with a new schedule_id.

Ok, so that worked great, but now I'm learning that there are
disadvantages to having multiple databases for one app. In my new
cakePHP version of this app, I want to try to get all of this
functionality under one "roof."

One idea I had was to have scheduler_public be the only database (just
call it scheduler) and in that schedules table have a boolean field
called published. Or even better, a field called publish_date (which
would be null if the schedule is not published yet). So the public
could easily view the latest published schedule, and the scheduler who
logs in could edit the schedule that has not been published yet.

Two questions:
    1. Am I going in the right direction here, or does this seem way
off?
    2. Assuming this works, could I just access everything through the
schedule model? In other words, the current "schedule" is a group of
data from all of the tables with the same schedule_id, so when I'm
viewing schedule #2133 I would get everything I need as related model
data from the schedule model... I am thinking the schedule id would be
in the session which would default to the most recently published...
so, the schedules controller would get the current schedule id from
the session and hand it to the schedule model. If I want to view
person #3, it would be ('controller' => 'schedules', 'action' =>
'view_person', 3) and then the schedule model would fetch the person
data (and the shift data, and the area data... it's all needed to
display a person and their info).

I guess I'm back to question #1... does this make sense??

Thanks so much for your thoughts,
Jason

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