Commit 767172a6 authored by jwage's avatar jwage

fixes #721

parent d47f4dda
......@@ -279,12 +279,20 @@ abstract class Doctrine_Record_Abstract extends Doctrine_Access
{
$this->_table->setColumn($name, $type, $length, $options);
}
/**
* hasColumns
*
* @param array $definitions
* @return void
*/
public function hasColumns(array $definitions)
{
foreach ($definitions as $name => $options) {
$this->hasColumn($name, $options['type'], $options['length'], $options);
}
}
}
/**
* loadTemplate
*
......
......@@ -76,22 +76,6 @@ class User extends Doctrine_Record
>> Note: You should only use unique constraints for other than primary key columns. Primary key columns are always unique.
The following definition adds a unique constraint for columns {{name}} and {{age}}.
<code type="php">
class User extends Doctrine_Record
{
public function setTableDefinition()
{
$this->hasColumn('name', 'string', 200);
$this->hasColumn('age', 'integer', 2);
$this->unique(array('name', 'age'));
}
}
</code>
+++ Check
Some of the Doctrine validators also act as database level check constraints. When a record with these validators is exported additional CHECK constraints are being added to CREATE TABLE statement.
......
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