for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of the Sonata package.
*
* (c) Thomas Rabaix <[email protected]>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Sonata\TranslationBundle\Admin\Extension\Knplabs;
use Sonata\AdminBundle\Admin\AdminInterface;
use Sonata\TranslationBundle\Admin\Extension\AbstractTranslatableAdminExtension;
/**
* @author Alfonso Machado <[email protected]>
class TranslatableAdminExtension extends AbstractTranslatableAdminExtension
{
* {@inheritdoc}
public function alterNewInstance(AdminInterface $admin, $object)
if ($this->getTranslatableChecker()->isTranslatable($object)) {
$object->setLocale($this->getTranslatableLocale($admin));
}
public function alterObject(AdminInterface $admin, $object)
public function preUpdate(AdminInterface $admin, $object)
$object->mergeNewTranslations();
public function prePersist(AdminInterface $admin, $object)