This commit is contained in:
2024-11-20 15:55:20 +03:00
commit 12b888a674
5 changed files with 266 additions and 0 deletions

36
ActiveRecord.php Normal file
View File

@@ -0,0 +1,36 @@
<?php
namespace dominion\db;
/**
*
*/
class ActiveRecord extends \yii\db\ActiveRecord
{
protected static $tableSchemaCache = [];
/**
* этот класс позволяет ускорить работу за счет хранения структуры бд
*/
public static function getTableSchema()
{
if(!isset(self::$tableSchemaCache[static::tableName()]))
{
self::$tableSchemaCache[static::tableName()] = parent::getTableSchema();
}
return self::$tableSchemaCache[static::tableName()];
}
/**
* этот класс позволяет ускорить работу за счет отказа от получения списка атрибутов из схемы бд
* /
public function attributes()
{
return array_keys($this->attributeLabels());
}*/
public function init()
{
}
}