2008-05-30 11:40:08 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* This is i18n Schema file
|
|
|
|
*
|
|
|
|
* Use it to configure database for i18n
|
|
|
|
*
|
2009-11-06 06:00:11 +00:00
|
|
|
* @link http://cakephp.org CakePHP(tm) Project
|
2011-10-14 19:06:36 +00:00
|
|
|
* @package app.Config.Schema
|
2008-10-30 17:30:26 +00:00
|
|
|
* @since CakePHP(tm) v 0.2.9
|
2008-05-30 11:40:08 +00:00
|
|
|
*/
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2013-02-08 13:41:57 +00:00
|
|
|
/**
|
2008-05-30 11:40:08 +00:00
|
|
|
* Using the Schema command line utility
|
2013-02-03 19:00:32 +00:00
|
|
|
*
|
|
|
|
* Use it to configure database for i18n
|
|
|
|
*
|
2008-05-30 11:40:08 +00:00
|
|
|
* cake schema run create i18n
|
|
|
|
*/
|
2013-02-08 13:41:57 +00:00
|
|
|
class I18nSchema extends CakeSchema {
|
2012-11-04 11:23:36 +00:00
|
|
|
|
2014-05-28 03:19:44 +00:00
|
|
|
/**
|
|
|
|
* The name property
|
|
|
|
*
|
|
|
|
* @var string
|
|
|
|
*/
|
2010-04-04 07:14:00 +00:00
|
|
|
public $name = 'i18n';
|
2008-05-30 11:40:08 +00:00
|
|
|
|
2014-05-28 03:19:44 +00:00
|
|
|
/**
|
|
|
|
* Before event.
|
|
|
|
*
|
|
|
|
* @param array $event The event data.
|
2014-07-03 13:36:42 +00:00
|
|
|
* @return bool success
|
2014-05-28 03:19:44 +00:00
|
|
|
*/
|
2011-05-30 20:02:32 +00:00
|
|
|
public function before($event = array()) {
|
2008-05-30 11:40:08 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2014-05-28 03:19:44 +00:00
|
|
|
/**
|
|
|
|
* After event.
|
|
|
|
*
|
|
|
|
* @param array $event The event data.
|
|
|
|
* @return void
|
|
|
|
*/
|
2011-05-30 20:02:32 +00:00
|
|
|
public function after($event = array()) {
|
2008-05-30 11:40:08 +00:00
|
|
|
}
|
|
|
|
|
2014-05-28 03:19:44 +00:00
|
|
|
/**
|
|
|
|
* The i18n table property
|
|
|
|
*
|
|
|
|
* @var array
|
|
|
|
*/
|
2010-04-04 07:14:00 +00:00
|
|
|
public $i18n = array(
|
2012-03-03 23:55:07 +00:00
|
|
|
'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'length' => 10, 'key' => 'primary'),
|
|
|
|
'locale' => array('type' => 'string', 'null' => false, 'length' => 6, 'key' => 'index'),
|
|
|
|
'model' => array('type' => 'string', 'null' => false, 'key' => 'index'),
|
|
|
|
'foreign_key' => array('type' => 'integer', 'null' => false, 'length' => 10, 'key' => 'index'),
|
|
|
|
'field' => array('type' => 'string', 'null' => false, 'key' => 'index'),
|
|
|
|
'content' => array('type' => 'text', 'null' => true, 'default' => null),
|
|
|
|
'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1), 'locale' => array('column' => 'locale', 'unique' => 0), 'model' => array('column' => 'model', 'unique' => 0), 'row_id' => array('column' => 'foreign_key', 'unique' => 0), 'field' => array('column' => 'field', 'unique' => 0))
|
|
|
|
);
|
2008-05-30 11:40:08 +00:00
|
|
|
|
|
|
|
}
|