28 lines
558 B
PHP
28 lines
558 B
PHP
<?php
|
|
|
|
namespace Trinity\Component\Propel;
|
|
use I18nBehavior;
|
|
use ReflectionObject;
|
|
use SluggableBehavior;
|
|
|
|
class I18nSluggableBehavior extends I18nBehavior
|
|
{
|
|
|
|
public function __construct()
|
|
{
|
|
if (null === $this->dirname) {
|
|
$extend = new ReflectionObject(new I18nBehavior());
|
|
$this->dirname = dirname($extend->getFileName());
|
|
}
|
|
}
|
|
|
|
public function modifyTable()
|
|
{
|
|
parent::modifyTable();
|
|
|
|
//add sluggableBehavior
|
|
$this->i18nTable->addBehavior(new SluggableBehavior());
|
|
}
|
|
|
|
}
|