AOOSModel: Added constraints
commitb2be488515d95f7a0de3ad372a79f6771cca82d6
authorSebastian Skejø <sebastian@sebastian.localdomain>
Mon, 1 Jun 2009 19:45:24 +0000 (1 21:45 +0200)
committerSebastian Skejø <sebastian@sebastian.localdomain>
Mon, 1 Jun 2009 19:45:24 +0000 (1 21:45 +0200)
tree9c842349d82e12185e1cac869657b6beca2bed9a
parent8782c34b6a4f8fe09eb0435f6d0b37cf5309b25e
AOOSModel: Added constraints

Added a concept of constraint to AOOSModel. Constraints are given to each column, just like properties, but have the
ability to take arguments. This makes it possible make length constraints, match constraints, range constraints etc. As
example the three mentioned constraints are implemented in lib/AOOSModelConstraints.php.
To give a column a constraint simply call:

    $model->addConstraint("ConstraintName",  "ColumnName", "ArrayOfArgs");

Note that the constraint name is without Constraint in the end, which the implementations of constraints have.

At the moment constraints changes data without giving any notice about this. This might change, but it seems fairly
reasonable not to give any notice.

Example usage is added in index.php

A bit of fixes in AOOSModel was included too.
AOOSModel.php
index.php
lib/AOOSInterfaces.php
lib/AOOSModelConstraints.php [new file with mode: 0644]