Ralph Schindler-2 wrote:
> 
> Right, as I mentioned, I might rethink the design of the two database
> system
> for your application.  It might prove easier to put a column inside of
> your
> tables that would mark a row as 'admin' or not.
> 

I agree 100%.
Duplicating (part of) your database structure goes against every
normalization rule! An extra column would be the most obvious choice here.

If you are worried that you might forget the filter in some queries and
thereby exposing admin-data, you could solve that by writing a clever parent
class from which you extend all your other table-classes. If you give this
column (indicating whether the data belongs to the admin or not) always the
same name, you could write a mechanism in this parent class which checks if
the query is dealing with a table that has this column and then checks
whether an admin is logged in. If not, it adds another WHERE condition (if
not already present) that filters out the admin-data.

-----
http://devshed.excudo.net http://devshed.excudo.net 
-- 
View this message in context: 
http://www.nabble.com/Using-2-databases-with-Zend_Db%2C-when-you-have-the-same-model.-tp21132662p21190945.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to