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