state = $state ?: new Registry(); $this->db = $db ?: Factory::getDbo(); } /** * Get the database driver. * * @return DatabaseDriver * * @since 4.0.0 */ public function getDb() { return $this->db; } /** * Get the model state. * * @return Registry * * @since 4.0.0 */ public function getState() { return $this->state; } /** * Set the database driver. * * @param DatabaseDriver $db The database driver. * * @return void * * @since 4.0.0 */ public function setDb(DatabaseDriver $db) { $this->db = $db; } /** * Set the model state. * * @param Registry $state The state object. * * @return void * * @since 4.0.0 */ public function setState(Registry $state) { $this->state = $state; } }