Example #1
0
 public function fields()
 {
     $this->role_id = PrimaryField::create()->setLabel('@string/role_id');
     $this->role_name = TextField::create(32)->setLabel('@string/role')->setRequired(TRUE);
     $this->role_rights = TextAreaField::create()->setLabel('@string/rights');
     $this->users = Many2ManyField::create('User', 'user_id', 'UserRole', 'role_id')->setLabel('@string/users');
 }
Example #2
0
 public function fields()
 {
     $this->object_id = PrimaryField::create()->setLabel('@string/object_id');
     $this->object_name = TextField::create(32)->setLabel('@string/object_name')->setRequired(TRUE);
     $this->user_id = Many2OneField::create('User')->setLabel('@string/user_id');
     $this->date = DateField::create();
     $this->time = TimeField::create();
     $this->value = DoubleField::create()->setDefaultValue(5.0)->setRequired(TRUE);
     $this->enumerate = EnumField::create(array('first' => 'First', 'second' => 'Second'))->setDefaultValue('first');
 }
Example #3
0
 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');
 }
Example #4
0
 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'));
 }