-
Notifications
You must be signed in to change notification settings - Fork 0
Entity Definition
lpachecob edited this page Mar 22, 2026
·
4 revisions
In BOUNDLY, your domain entities are your database schema. No migrate files needed. Just attributes.
Required for every persistent class.
| Property | Default | Description |
|---|---|---|
table |
NULL |
The DB table name. |
resource |
NULL |
The API resource name (plural). |
primaryKey |
'id' |
The PK column name. |
connection |
'mysql' |
DB connection to use. |
#[Entity(table: 'users', resource: 'users')]
class User extends AggregateRoot { ... }Defines the DB column properties.
| Property | Default | Description |
|---|---|---|
type |
'string' |
The type (string, integer, boolean, decimal, etc.). |
length |
255 |
Max length for strings. |
nullable |
false |
If TRUE, the DB column will allow NULLs. |
default |
NULL |
The default value for the column. |
unique |
false |
If TRUE, adds a unique index in the DB. |
#[Column(type: 'string', length: 150, unique: true)]
private string $email;Marks the primary key of the entity. Generally used with private int $id.
-
string(VARCHAR) -
text(TEXT) -
integer(INT) -
boolean(TINYINT) -
decimal(DECIMAL) -
date/datetime/timestamp -
json(JSON)
#[Entity(table: 'posts', resource: 'posts')]
class Post extends AggregateRoot
{
#[Id]
private int $id;
#[Column(type: 'string', length: 100)]
private string $title;
#[Column(type: 'text')]
private string $content;
#[Column(type: 'boolean', default: false)]
private bool $is_published;
}Next Step: Action-Definition 🚀