Trait Yiisoft\ActiveRecord\Trait\CustomTableNameTrait
Trait to implement a custom table name for ActiveRecord.
See also \Yiisoft\ActiveRecord\Trait\ActiveRecordInterface::tableName().
Public Methods
| Method | Description | Defined By |
|---|---|---|
| tableName() | Yiisoft\ActiveRecord\Trait\CustomTableNameTrait | |
| withTableName() | Sets the table name for the ActiveRecord. | Yiisoft\ActiveRecord\Trait\CustomTableNameTrait |
Method Details
| public string tableName ( ) |
public function tableName(): string
{
return $this->tableName ??= parent::tableName();
}
Sets the table name for the ActiveRecord.
| public Yiisoft\ActiveRecord\Trait\CustomTableNameTrait withTableName ( string $tableName ) | ||
| $tableName | string | |
public function withTableName(string $tableName): static
{
$new = clone $this;
$new->tableName = $tableName;
return $new;
}
Signup or Login in order to comment.