-
-
Save anonymous/63a2ab8d80384f6fef12 to your computer and use it in GitHub Desktop.
editaction is used to send the unit object and then i use it to retrieve target using my own method
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
/** | |
* edit action | |
* @param \Somea\Translation\Domain\Model\TranslationUnit $unit An Unit to edit | |
* @param \Somea\Translation\Domain\Model\TranslationPackage $package | |
* @param \Somea\Translation\Domain\Model\TranslationLanguage $language | |
* @return void | |
*/ | |
public function editAction(TranslationUnit $unit, TranslationPackage $package, TranslationLanguage $language) { | |
$target= $this->translationTargetRepository->findTargetByUnitAndLanguages($unit, $language); | |
$this->view->assign('title','Edit Translation Unit'); | |
$this->view->assign('packages', $package); | |
$this->view->assign('languages', $language); | |
$this->view->assign('unit', $unit); | |
//$this->view->assign('target', $target); | |
} | |
/** | |
* Set property mapper configuration for target creation | |
* @return void | |
*/ | |
public function initializeUpdateAction(){ | |
$this->arguments['target']->getPropertyMappingConfiguration()->allowCreationForSubProperty('translationUnit'); | |
$this->arguments['target']->getPropertyMappingConfiguration()->allowModificationForSubProperty('translationUnit'); | |
} | |
/** | |
* update action | |
* @param \Somea\Translation\Domain\Model\TranslationTarget $target A new unit to add | |
* @param \Somea\Translation\Domain\Model\TranslationPackage $package A new Package to add | |
* @param \Somea\Translation\Domain\Model\TranslationLanguage $language A new Language to add | |
* @return void | |
*/ | |
public function updateAction(TranslationTarget $target, TranslationPackage $package, TranslationLanguage $language) { | |
$this->translationTargetRepository->update($target); | |
$this->redirect('index','TranslationUnit','Somea.Translation',array('language' => $language, 'package' => $package)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment