Tinebase_Export - add twig function relationTranslateModel
authorPaul Mehrer <p.mehrer@metaways.de>
Thu, 3 Aug 2017 10:41:51 +0000 (12:41 +0200)
committerPaul Mehrer <p.mehrer@metaways.de>
Fri, 4 Aug 2017 14:42:47 +0000 (16:42 +0200)
Change-Id: Ideffad502b9f24249e82c8f63fad0f49fa100ef2
Reviewed-on: http://gerrit.tine20.com/customers/5383
Tested-by: Jenkins CI (http://ci.tine20.com/) <tine20-jenkins@metaways.de>
Reviewed-by: Paul Mehrer <p.mehrer@metaways.de>
Tested-by: Paul Mehrer <p.mehrer@metaways.de>
tine20/Tinebase/Export/Abstract.php

index a867147..36f7d31 100644 (file)
@@ -573,6 +573,10 @@ abstract class Tinebase_Export_Abstract implements Tinebase_Record_IteratableInt
         $this->_twigEnvironment->addFunction(new Twig_SimpleFunction('dateFormat', function ($date, $format) {
             return Tinebase_Translation::dateToStringInTzAndLocaleFormat($date, null, null, $format);
         }));
         $this->_twigEnvironment->addFunction(new Twig_SimpleFunction('dateFormat', function ($date, $format) {
             return Tinebase_Translation::dateToStringInTzAndLocaleFormat($date, null, null, $format);
         }));
+        $this->_twigEnvironment->addFunction(new Twig_SimpleFunction('relationTranslateModel', function ($model) {
+            // TODO implement this!
+            return $model;
+        }));
 
         $this->_twigTemplate = $this->_twigEnvironment->load($this->_templateFileName);
     }
 
         $this->_twigTemplate = $this->_twigEnvironment->load($this->_templateFileName);
     }
@@ -821,6 +825,7 @@ abstract class Tinebase_Export_Abstract implements Tinebase_Record_IteratableInt
 
                     foreach ($this->_foreignIdFields as $name => $controller) {
                         if (!empty($record->{$name})) {
 
                     foreach ($this->_foreignIdFields as $name => $controller) {
                         if (!empty($record->{$name})) {
+                            /** @var Tinebase_Controller_Record_Abstract $controller */
                             $controller = $controller::getInstance();
                             $record->{$name} = $controller->get($record->{$name});
                         }
                             $controller = $controller::getInstance();
                             $record->{$name} = $controller->get($record->{$name});
                         }