- Added limitation on fixedValue in Where attribute
This commit is contained in:
1 parent
1fac12c928
commit
589524ca3a
5 files changed
+28
-19
No files matched your search
@@ -5,7 +5,7 @@ namespace Ulmus\Entity\InformationSchema;
|
||||
use Ulmus\EntityCollection,
|
||||
Ulmus\Entity\Field\Datetime;
|
||||
|
||||
use Ulmus\{Attribute\Obj\Table as TableObj};
|
||||
use Ulmus\{Attribute\Obj\Table as TableObj, Entity\EntityInterface};
|
||||
use Ulmus\Attribute\Property\{Field, Filter, FilterJoin, Relation, Join, Virtual, Where};
|
||||
|
||||
#[TableObj(name: "tables", database: "information_schema")]
|
||||
@@ -83,6 +83,12 @@ class Table
|
||||
public ? string $temporary;
|
||||
|
||||
#[Relation(type: "oneToMany", key: "name", foreignKey: [ Column::class, 'tableName' ], entity: Column::class)]
|
||||
#[Where('TABLE_SCHEMA', fieldValue: [ Column::class, 'tableSchema' ])]
|
||||
#[Where(field: 'TABLE_SCHEMA', generateValue: [ Table::class, 'getSchema' ])]
|
||||
public EntityCollection $columns;
|
||||
|
||||
# Awaiting PHP 8.5 https://wiki.php.net/rfc/closures_in_const_expr
|
||||
public static function getSchema(Table $entity) : string
|
||||
{
|
||||
return $entity->schema;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user