Example #1
0
$article->title = 'test';
$t->is($article->Translation['en']->title, 'test');

sfContext::getInstance()->getUser()->setCulture('fr');
$article->title = 'fr test';
$t->is($article->Translation['fr']->title, 'fr test');

$t->is($article->getTitle(), $article->title);
$article->setTitle('test');
$t->is($article->getTitle(), 'test');

$article->setTestColumn('test');
$t->is($article->getTestColumn(), 'test');
$t->is($article->Translation['fr']['test_column'], 'test');

$article->free(true);

class MyArticleForm extends ArticleForm
{
  public function configure()
  {
    parent::configure();

    $this->embedI18n(array('en', 'fr'));

    $authorForm = new AuthorForm($this->object->Author);
    unset($authorForm['id']);

    $this->embedForm('Author', $authorForm);

    unset($this['author_id']);