Commit a336d424 authored by zYne's avatar zYne

--no commit message

--no commit message
parent da86fd89
<code type='php'>
// export everything, table definitions and constraints
$manager->setAttribute(Doctrine::ATTR_EXPORT, Doctrine::EXPORT_ALL);
// export classes without constraints
$manager->setAttribute(Doctrine::ATTR_EXPORT, Doctrine::EXPORT_TABLES ^
Doctrine::EXPORT_CONSTRAINTS);
</code>
......@@ -17,3 +17,7 @@ class User extends Doctrine_Record
When this class gets exported to database the following Sql statement would get executed (in Mysql):
CREATE TABLE user (name VARCHAR(200) NOT NULL, PRIMARY KEY(name))
The notnull constraint also acts as an application level validator. This means that if Doctrine validators are turned on, Doctrine will automatically check that specified columns do not contain null values when saved.
If those columns happen to contain null values Doctrine_Validator_Exception is raised.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment