Created
May 12, 2016 13:21
-
-
Save daum/eccfc290bdc8c3b26d6bd9f639cad3d1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$items = $em->getRepository('AppBundle:ExampleEntity')->findAll(); | |
foreach($items as $i){ | |
$c = new \ReflectionClass("AppBundle\\Entity\\ExampleEntity"); | |
$prop = $c->getProperty('visible_label'); | |
$prop->setAccessible(true); | |
$i->translate('en')->setVisibleLabel($prop->getValue($i)); | |
$i->mergeNewTranslations(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment