| 48 | | } |
|---|
| | 48 | $this->addI18nMethods($script); |
|---|
| | 49 | } |
|---|
| | 50 | } |
|---|
| | 51 | |
|---|
| | 52 | protected function addI18nMethods(&$script) |
|---|
| | 53 | { |
|---|
| | 54 | $table = $this->getTable(); |
|---|
| | 55 | foreach ($table->getReferrers() as $fk) |
|---|
| | 56 | { |
|---|
| | 57 | $tblFK = $fk->getTable(); |
|---|
| | 58 | if ($tblFK->getName() == $table->getAttribute('i18nTable')) |
|---|
| | 59 | { |
|---|
| | 60 | $i18nClassName = $tblFK->getPhpName(); |
|---|
| | 61 | break; |
|---|
| | 62 | } |
|---|
| | 63 | } |
|---|
| | 64 | |
|---|
| | 65 | $script .= " |
|---|
| | 66 | |
|---|
| | 67 | /** |
|---|
| | 68 | * Returns the i18n model class name. |
|---|
| | 69 | * |
|---|
| | 70 | * @return string The i18n model class name |
|---|
| | 71 | */ |
|---|
| | 72 | public static function getI18nModel() |
|---|
| | 73 | { |
|---|
| | 74 | return '$i18nClassName'; |
|---|
| | 75 | } |
|---|
| | 76 | "; |
|---|