- WIP on attributes ; on testing phase

This commit is contained in:
Dave M. 2023-01-26 13:35:06 +00:00
parent 374b056754
commit c0f54ef12f
1 changed files with 17 additions and 45 deletions

View File

@ -4,81 +4,53 @@ namespace Ulmus\User\Entity;
use Ulmus\Entity\Field\Datetime;
use Ulmus\Attribute\Property\Field;
class User {
/**
* @Id('readonly' => true)
*/
#[Field\Id(readonly: true)]
public int $id;
/**
* @Field("size" => 35, "name" => "first_name")
*/
#[Field(length: 35, name: "first_name")]
public ? string $firstName;
/**
* @Field("size" => 35, "name" => "last_name")
*/
#[Field(length: 35, name: "last_name")]
public ? string $lastName;
/**
* @Field("size" => 150)
*/
#[Field(length: 150)]
public string $email;
/**
* @Field("size" => 150)
*/
#[Field(length: 150)]
public ? string $address;
/**
* @Field("size" => 15, 'name' => "zip_code")
*/
#[Field(length: 15, name: "zip_code")]
public ? string $zipCode;
/**
* @Field("size" => 45)
*/
#[Field(length: 45)]
public ? string $province;
/**
* @Field("size" => 3)
*/
#[Field(length: 3)]
public ? string $country;
/**
* @Field("size" => 15)
*/
#[Field(length: 15)]
public ? string $phone;
/**
* @Field("size" => 15)
*/
#[Field(length: 15)]
public ? string $ext;
/**
* @Field("size" => 15)
*/
#[Field(length: 15)]
public ? string $mobile;
/**
* @Field("size" => 255)
*/
#[Field(length: 255)]
public ? string $username;
/**
* @Field
*/
#[Field]
public string $password;
/**
* @UpdatedAt('readonly' => true, 'name' => "updated_at")
*/
#[Field\UpdatedAt(readonly: true, name: "updated_at")]
public ? Datetime $updatedAt;
/**
* @CreatedAt('readonly' => true, 'name' => "created_at")
*/
#[Field\CreatedAt(readonly: true, name: "created_at")]
public Datetime $createdAt;
public bool $logged = false;