Closed mpyw closed 6 months ago
/** * Determine if the given view exists. * * @param string $view * @return bool */ public function hasView($view) { $view = $this->connection->getTablePrefix().$view; foreach ($this->getViews() as $value) { if (strtolower($view) === strtolower($value['name'])) { return true; } } return false; }
public function hasView(string $view): bool { return count($this->connection->selectFromWriteConnection($this->grammar->compileViewExists(), [ $this->connection->getConfig()['schema'], $this->connection->getTablePrefix() . $view, ])) > 0; }