Changed the core Object to not require any params in the constructor, and now we rely on polymorphism in the classes themselves to override that.
git-svn-id: http://svn.cleancode.org/svn/pickles@74 4d10bc64-7434-11dc-a737-d2d0f8310089
This commit is contained in:
parent
3fc3f74e75
commit
d2d6c47682
12 changed files with 166 additions and 48 deletions
|
@ -35,39 +35,10 @@
|
|||
*/
|
||||
class Object {
|
||||
|
||||
/**
|
||||
* Protected instance of the Config class
|
||||
*/
|
||||
protected $config = null;
|
||||
|
||||
/**
|
||||
* Protected instance of the DB class
|
||||
*/
|
||||
protected $db = null;
|
||||
|
||||
protected $logger = null;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* Handles getting an instance of the Config class.
|
||||
*
|
||||
* @param object Config object
|
||||
*/
|
||||
public function __construct(Config $config, DB $db = null) {
|
||||
if (isset($config)) {
|
||||
$this->config = $config;
|
||||
}
|
||||
|
||||
if (isset($db)) {
|
||||
$this->db = $db;
|
||||
}
|
||||
|
||||
$parents = class_parents($this);
|
||||
|
||||
$logger = new Logger();
|
||||
$logger->write('object', get_class($this) . (is_array($parents) ? ' -> ' . implode(' -> ', $parents) : ''));
|
||||
}
|
||||
public function __construct() { }
|
||||
|
||||
/**
|
||||
* Destructor
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue