0 follower

Trait Yiisoft\ActiveRecord\Trait\CustomTableNameTrait

Trait to implement a custom table name for ActiveRecord.

See also \Yiisoft\ActiveRecord\Trait\ActiveRecordInterface::tableName().

Method Details

Hide inherited methods

tableName() public method

public string tableName ( )

                public function tableName(): string
{
    return $this->tableName ??= parent::tableName();
}

            
withTableName() public method

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;
}