1
0
mirror of synced 2024-12-13 14:56:01 +03:00

Updated docs

This commit is contained in:
zYne 2006-09-29 10:58:38 +00:00
parent 14b95350d0
commit 1ff90159d6
2 changed files with 211 additions and 35 deletions

View File

@ -0,0 +1,2 @@
Natural identifier is a property or combination of properties that is unique and non-null. The use of natural identifiers
is discouraged. You should consider using autoincremented or sequential primary keys as they make your system more scalable.

View File

@ -1,35 +1,209 @@
Following data types and constraints are availible in doctrine
<ul>
<li /><b> unique</b>
<ul> Acts as database level unique constraint. Also validates that the specified column is unique.
</ul>
<li /><b> nospace</b>
<ul> Nospace validator. This validator validates that specified column doesn't contain any space/newline characters. <br />
</ul>
<li /><b> notblank</b>
<ul> Notblank validator. This validator validates that specified column doesn't contain only space/newline characters. Useful in for example comment posting applications
where users are not allowed to post empty comments. <br />
</ul>
<li /><b> notnull</b>
<dd /> Acts as database level notnull constraint as well as notnull validator for the specified column.<br />
<li /><b> email</b>
<dd /> Email validator. Validates that specified column is a valid email address.
<li /><b> date</b>
<dd /> Date validator.
<li /><b> range:[args]</b>
<dd /> Range validator, eg range:1-32
<li /><b> enum:[args]</b>
<dd /> Enum validator, eg enum:city1-city2-city3
<li /><b> country</b>
<ul> Country code validator validates that specified column has a valid country code.
</ul>
<li /><b> regexp:[args]</b>
<ul> Regular expression validator validates that specified column matches a regular expression, eg regexp:[John]
</ul>
<li /><b> ip</b>
<ul> Ip validator validates that specified column is a valid internet protocol address.
</ul>
<li /><b> usstate</b>
<ul> Usstate validator validates that specified column is a valid usstate.
</ul>
</ul>
Following attributes are availible for columns
<table>
<tr>
<td>
<b class='title' valign='top'>name</b>
</td>
<td>
<b class='title' valign='top'>args</b>
</td>
<td>
<b class='title'>description</b>
</td>
</tr>
<tr>
<td colspan=3>
<hr>
</td>
</tr>
<tr>
<td colspan=3>
&raquo;&raquo; Basic attributes
<hr class='small'>
</td>
</tr>
<tr>
<td class='title' valign='top'>
<b>primary</b>
</td>
<td class='title' valign='top'>
bool true
</td>
<td class='title' valign='top'>
Defines column as a primary key column.
</td>
</tr>
<tr>
<td class='title' valign='top'>
<b>autoincrement</b>
</td>
<td class='title' valign='top'>
bool true
</td>
<td class='title' valign='top'>
Defines column as autoincremented column. If the underlying database doesn't support autoincrementation natively its emulated with triggers and sequence tables.
</td>
</tr>
<tr>
<td class='title' valign='top'>
<b>default</b>
</td>
<td class='title' valign='top'>
mixed default
</td>
<td class='title' valign='top'>
Sets <i>default</i> as an application level default value for a column. When default value has been set for a column every time a record is created the specified column has the <i>default</i> as its value.
</td>
</tr>
<tr>
<td class='title' valign='top'>
<b>enum</b>
</td>
<td class='title' valign='top'>
array enum
</td>
<td class='title' valign='top'>
Sets <i>enum</i> as an application level enum value list for a column.
</td>
</tr>
<tr>
<td colspan=3>
&raquo;&raquo; Basic validators
<hr class='small'>
</td>
</tr>
<tr>
<td class='title' valign='top'>
<b>unique</b>
</td>
<td class='title' valign='top'>
bool true
</td>
<td class='title' valign='top'>
Acts as database level unique constraint. Also validates that the specified column is unique.
</td>
</tr>
<tr>
<td class='title' valign='top'>
<b>nospace</b>
</td>
<td class='title' valign='top'>
bool true
</td>
<td class='title' valign='top'>
Nospace validator. This validator validates that specified column doesn't contain any space/newline characters. <br />
</td>
</tr>
<tr>
<td class='title' valign='top'>
<b>notblank</b>
</td>
<td class='title' valign='top'>
bool true
</td>
<td class='title' valign='top'>
Notblank validator. This validator validates that specified column doesn't contain only space/newline characters. Useful in for example comment posting applications
where users are not allowed to post empty comments.
</td>
</tr>
<tr>
<td class='title' valign='top'>
<b>notnull</b>
</td>
<td class='title' valign='top'>
bool true
</td>
<td class='title' valign='top'>
Acts as database level notnull constraint as well as notnull validator for the specified column.
</td>
</tr>
<tr>
<td colspan=3>
&raquo;&raquo; Advanced validators
<hr class='small'>
</td>
</tr>
<tr>
<td class='title' valign='top'>
<b>email</b>
</td>
<td class='title' valign='top'>
bool true
</td>
<td class='title' valign='top'>
Email validator. Validates that specified column is a valid email address.
</td>
</tr>
<tr>
<td class='title' valign='top'>
<b>date</b>
</td>
<td class='title' valign='top'>
bool true
</td>
<td class='title' valign='top'>
Date validator.
</td>
</tr>
<tr>
<td class='title' valign='top'>
<b>range</b>
</td>
<td class='title' valign='top'>
array(min, max)
</td>
<td class='title' valign='top'>
Range validator. Validates that the column is between <i>min</i> and <i>max</i>.
</td>
</tr>
<tr>
<td class='title' valign='top'>
<b>country</b>
</td>
<td class='title' valign='top'>
bool true
</td>
<td class='title' valign='top'>
Country code validator validates that specified column has a valid country code.
</td>
</tr>
<tr>
<td class='title' valign='top'>
<b>regexp </b>
</td>
<td class='title' valign='top'>
string regexp
</td>
<td class='title' valign='top'>
Regular expression validator validates that specified column matches <i>regexp</i>.
</td>
</tr>
<tr>
<td class='title' valign='top'>
<b>ip</b>
</td>
<td class='title' valign='top'>
bool true
</td>
<td class='title' valign='top'>
Ip validator validates that specified column is a valid internet protocol address.
</td>
</tr>
<tr>
<td class='title' valign='top'>
<b>usstate</b>
</td>
<td class='title' valign='top'>
bool true
</td>
<td class='title' valign='top'>
Usstate validator validates that specified column is a valid usstate.
</td>
</tr>
</table>