public function fields() { $this->user_id = PrimaryField::create()->setLabel('@string/user_id'); $this->firstname = TextField::create(32)->setLabel('@string/firstname')->setRequired(TRUE); $this->lastname = TextField::create(32)->setLabel('@string/lastname')->setRequired(TRUE); $this->mail = EmailField::create()->setLabel('@string/mail')->setRequired(TRUE); $this->password = PasswordField::create(32)->setLabel('@string/password')->setRequired(TRUE)->setConverter(new PasswordConverter()); $this->user_active = BooleanField::create()->setLabel('@string/active')->setRequired(TRUE)->setDefaultValue(TRUE); $this->creation_date = DateTimeField::create()->setLabel('@string/creation_date')->setRequired(TRUE)->setEditable(FALSE)->setDefaultValue(RawSQL::select('CURRENT_TIMESTAMP')); $this->roles = Many2ManyField::create('Role', 'role_id', 'UserRole', 'user_id')->setLabel('@string/roles'); }
public function fields() { $this->asset_id = PrimaryField::create()->setLabel('@string/asset_id'); $this->public_url = TextField::create(255)->setLabel('@string/URL')->setRequired(TRUE); $this->creation_date = DateTimeField::create()->setLabel('@string/creation_date')->setRequired(TRUE)->setEditable(FALSE)->setDefaultValue(RawSQL::select('CURRENT_TIMESTAMP')); }