Opened 8 years ago

Closed 7 years ago

Last modified 7 years ago

#761 closed feature request (duplicate)

MgdSchema needs required fields

Reported by: bergie Owned by: piotras
Priority: minor Milestone:
Component: Midgard Core Version: 9.09 Mjolnir
Keywords: iks Cc:

Description

To synchronize MgdSchema?'s features a bit with JCR Node Type Notation, we should support required properties.

If object is being saved without a required field having a value, Midgard should throw an exception and abort that save.

Something like:

<type name="org_openpsa_products_product">
    ...
    <property name="title" type="string" required="yes"/>
</type>

$product = new org_openpsa_products_product();
$product->description = "Blah";
// No title set
$product->create(); // Will throw midgard_error_requiredfield exception and not save the product

Change History (6)

comment:1 Changed 8 years ago by piotras

We need additional functionality here. There should be some way to define what is not null value for particular type. Is 0 allowed for int, for strings, etc.

comment:2 Changed 8 years ago by piotras

  • Milestone changed from 9.03 Vinland to 9.09 Mjolnir
  • Version changed from 9.03 Vinland to 9.09

comment:3 Changed 8 years ago by bergie

  • Keywords iks added

comment:4 Changed 8 years ago by bergie

  • Milestone changed from 9.09 Mjolnir to 10.03 Ratatoskr

comment:5 Changed 7 years ago by bergie

  • Resolution set to duplicate
  • Status changed from new to closed

comment:6 Changed 7 years ago by anonymous

  • Milestone 10.05.1 Ratatoskr deleted

Milestone 10.05.1 Ratatoskr deleted

Note: See TracTickets for help on using tickets.