Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MgdSchema needs required fields #24

Open
bergie opened this issue Jun 1, 2010 · 0 comments
Open

MgdSchema needs required fields #24

bergie opened this issue Jun 1, 2010 · 0 comments

Comments

@bergie
Copy link
Member

bergie commented Jun 1, 2010

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

(copied from http://trac.midgard-project.org/ticket/761)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant