改名
This commit is contained in:
@@ -201,7 +201,7 @@ abstract class GiiBase
|
|||||||
$html .= '
|
$html .= '
|
||||||
' . $debug . ' static' . $type;
|
' . $debug . ' static' . $type;
|
||||||
} else {
|
} else {
|
||||||
if ($key == 'primary') {
|
if ($key == 'primary' || $key == 'table' || $key == 'connection' || $key == 'rules') {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$html .= '
|
$html .= '
|
||||||
|
|||||||
+7
-15
@@ -127,12 +127,13 @@ use Database\ActiveRecord;
|
|||||||
|
|
||||||
$html .= $this->createTableName($this->tableName) . "\n";
|
$html .= $this->createTableName($this->tableName) . "\n";
|
||||||
|
|
||||||
|
$html .= $this->createDatabaseSource();
|
||||||
|
|
||||||
$html .= $this->createRules($this->fields);
|
$html .= $this->createRules($this->fields);
|
||||||
|
|
||||||
if (is_object($class)) {
|
if (is_object($class)) {
|
||||||
$html .= $this->getClassMethods($class, ['rules', 'tableName', 'attributes']);
|
$html .= $this->getClassMethods($class, ['rules', 'tableName', 'attributes']);
|
||||||
} else {
|
} else {
|
||||||
$html .= $this->createDatabaseSource();
|
|
||||||
$other = $this->generate_json_function($html, $this->fields);
|
$other = $this->generate_json_function($html, $this->fields);
|
||||||
if (!empty($other)) {
|
if (!empty($other)) {
|
||||||
$html .= implode($other);
|
$html .= implode($other);
|
||||||
@@ -228,11 +229,8 @@ use Database\ActiveRecord;
|
|||||||
/**
|
/**
|
||||||
* @inheritdoc
|
* @inheritdoc
|
||||||
*/
|
*/
|
||||||
public static function tableName(): string
|
protected string $table = \'' . $field . '\';
|
||||||
{
|
';
|
||||||
return \'' . $field . '\';
|
|
||||||
}
|
|
||||||
';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -282,12 +280,9 @@ use Database\ActiveRecord;
|
|||||||
/**
|
/**
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function rules(): array
|
public array $rules = [' . $_field_one . '
|
||||||
{
|
|
||||||
return [' . $_field_one . '
|
|
||||||
];
|
];
|
||||||
}
|
';
|
||||||
';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -402,10 +397,7 @@ use Database\ActiveRecord;
|
|||||||
* @return Connection
|
* @return Connection
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public static function getDb(): Connection
|
protected string $connection = \'' . $this->db->id . '\';
|
||||||
{
|
|
||||||
return static::setDatabaseConnect(\'' . $this->db->id . '\');
|
|
||||||
}
|
|
||||||
';
|
';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user