public function __construct(Factory $factory, $id = Null) { $this->logger = $factory->getLogger(); $this->db = $factory->getDb(); $this->collection = $factory->getCollection(); if (!$this->collection) { throw new Exception('Created model with no collection'); } $this->factory = $factory; $this->id = $id; }
public function __construct(TagFactory $tagFactory, Database $database, Logger $logger) { $this->tagFactory = $tagFactory; parent::__construct($database, $logger); }