20250804
This commit is contained in:
44
sources/attributes/ForeignKey.php
Normal file
44
sources/attributes/ForeignKey.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
/**
|
||||
* Отключаю несущественные инспекции (из-за Attribute)
|
||||
*
|
||||
* @noinspection PhpMultipleClassDeclarationsInspection
|
||||
*/
|
||||
|
||||
namespace goodboyalex\php_db_components_pack\attributes;
|
||||
|
||||
use Attribute;
|
||||
|
||||
/**
|
||||
* Атрибут указывающий имя поля в БД.
|
||||
*
|
||||
* @author Александр Бабаев
|
||||
* @package php_db_components_pack
|
||||
* @version 1.0
|
||||
* @since 1.0
|
||||
*/
|
||||
#[Attribute(flags: Attribute::TARGET_PROPERTY)]
|
||||
final readonly class ForeignKey
|
||||
{
|
||||
/**
|
||||
* @var string $TableName Имя таблицы.
|
||||
*/
|
||||
public string $TableName;
|
||||
|
||||
/**
|
||||
* @var string $FieldName Имя связываемого поля.
|
||||
*/
|
||||
public string $FieldName;
|
||||
|
||||
/**
|
||||
* Конструктор.
|
||||
*
|
||||
* @param string $table Имя таблицы.
|
||||
* @param string $fieldName Имя связываемого поля.
|
||||
*/
|
||||
public function __construct (string $table, string $fieldName)
|
||||
{
|
||||
$this->TableName = $table;
|
||||
$this->FieldName = $fieldName;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user