[Catalyst] Model Instances vs. Model Classes - Round 2

Peter Flanigan pjf at roxsoft.co.uk
Wed Jul 20 16:50:43 GMT 2011


On 20/07/11 07:25, Alejandro Imass wrote:
> 
> http://wiki.catalystframework.org/wiki/best_practices/models_definitive_guide
> 

In this example

    package Models::Model::HomeGrownModel;

    use base 'Catalyst::Model';

    use HomeGrown;

    sub COMPONENT {
      my ( $self, $app ) = @_;
      my $dbic_schema = $app->model('ModelsDB')->schema;
      return HomeGrown->new( schema => $dbic_schema );
    }

how are you ensuring 'ModelsDB' has been instantiated before
'HomeGrownModel'?

-- 

Regards



More information about the Catalyst mailing list