12-07-2007, 08:15 PM
|
#1 (permalink)
|
|
The Acquainted
Join Date: Nov 2007
Posts: 127
Thanks: 14
|
Constructor in an abstract class?
Is it safe to do the following:
PHP Code:
abstract class Db_Adapter_Abstract { public function __construct($config) { $this->connect($config); }
abstract protected function connect($config); }
It works since I've tested it. But I have this funny feeling on how it shouldn't be done. Since all my database adapters will have a common constructor, I figure it's alright to do.
What are your thoughts?
Thank you.
|
|
|
|