public function getColumns()
{
if (empty($this->columns)) {
$columns = Cache::get('table:columns:' . $this->table);
if (!$columns) {
$connect = DbProxy::getOption('connect');
$columns = DbProxy::fetchColumn('
SELECT COLUMN_NAME
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_SCHEMA = ?
AND TABLE_NAME = ?', [$connect['name'], $this->getName()]);
Cache::set('table:columns:' . $this->table, $columns);
Cache::addTag('table:columns:' . $this->table, 'db');
}
$this->columns = $columns;
}
return $this->columns;
}