Do I have to put parent::__construct($config) in my CakePHP data source?

Posted by Angel S. Moreno on Stack Overflow See other posts from Stack Overflow or by Angel S. Moreno
Published on 2011-01-17T21:51:45Z Indexed on 2011/01/17 21:53 UTC
Read the original article Hit count: 120

Filed under:
|

Is there a good reason to put

parent::__construct($config)

in the construct of a CakePHP data source I am developing? I see it being used in some of the data sources found in https://github.com/cakephp/datasources/blob/master/models/datasources/amazon_associates_source.php but not sure why. I could just do

private $_config = array();
function construct($config){
    $this->_config = $config;
}

and access my $config the same way.

© Stack Overflow or respective owner

Related posts about cakephp

Related posts about datasource