Class::DBI and stalinesque hiding of THE TRUTH

Simon Wistow simon at thegestalt.org
Fri Jun 23 11:09:47 BST 2006


On Fri, Jun 23, 2006 at 10:36:35AM +0100, Stig Brautaset said:
> We have something like this, where 'user_view' is a view of the  
> 'user_table' which only has active users:

My basic plan was to have something like


use Entity private => 1;


package Entity;

sub import {
	my %opts = @_;
	my $table = ($opts{private})? 'entity' : 'entity_private';
	__PACKAGE__->table($table);

}

and then create necessary views from other classes based on

	CREATE VIEW tag_private AS SELECT * from TAG WHERE entity_id IN 
                              (SELECT id FROM entity_private);

I just wondered if there was a more cunning way.

Simon


--
X-Gleitschirmfliegen: macht Spaaaasss!



More information about the london.pm mailing list