1
0
mirror of synced 2024-12-16 16:16:04 +03:00
doctrine2/manual/docs/Object relational mapping - Table options.php

36 lines
884 B
PHP
Raw Normal View History

2007-01-12 03:40:50 +03:00
<?php ?>
Doctrine offers various table options. All table options can be set via Doctrine_Record::option($optionName, $value)
<br \><br \>
For example if you are using Mysql and want to use INNODB tables it can be done as follows:
<br \><br \>
<?php
renderCode("<?php
class MyInnoDbRecord extends Doctrine_Record
{
public function setTableDefinition()
{
\$this->hasColumn('name', 'string');
2007-03-02 01:41:41 +03:00
\$this->option('type', 'INNODB');
2007-01-12 03:40:50 +03:00
}
}
?>");
?> <br \><br \>
In the following example we set the collate and character set options:
<br \><br \>
<?php
renderCode("<?php
class MyCustomOptionRecord extends Doctrine_Record
{
public function setTableDefinition()
{
\$this->hasColumn('name', 'string');
\$this->option('collate', 'utf8_unicode_ci');
\$this->option('charset', 'utf8');
}
}
?>");
?>