/** * @param string $name * @return void */ public function setConnection($name) { if (!is_null($name)) { $this->resolver->setDefaultConnection($name); } $this->repository->setSource($name); $this->connection = $name; }
/** * @param string|null $connection * @return \Notadd\Foundation\Database\Connection */ public static function resolveConnection($connection = null) { return static::$resolver->connection($connection); }
/** * @return \Notadd\Foundation\Database\Connection */ public function getConnection() { return $this->resolver->connection($this->connection); }
/** * @param string $table * @return \Notadd\Foundation\Database\Query\Builder */ protected function table($table) { return $this->db->connection($this->connection)->table($table); }
/** * @return void */ public function fire() { $this->resolver->setDefaultConnection($this->getDatabase()); $this->getSeeder()->run(); }