src/Gossamer/Pesedget/Commands/SaveCommand.php
private function saveI18nValues($firstResult, $requestParams, &$locale) {
       // file_put_contents('/var/www/db-repo/logs/cms.log', print_r($requestParams, true), FILE_APPEND);
        if(!$this->entity instanceof AbstractI18nEntity || is_null($locale)) {
            
            return;
        }
       // file_put_contents('/var/www/db-repo/logs/cms.log', print_r($requestParams, true), FILE_APPEND);
        
        $parsedLocales = $locale;//$this->parseJson($locale); 
       
        foreach($parsedLocales as $parsedLocale => $row) {
  
            $params = array($this->entity->getI18nIdentifier() => $firstResult, 'locale' => $parsedLocale);

            //need to add this, since it is what associates us to the parent table
            $row[$this->entity->getI18nIdentifier()] = $firstResult;
            $row['locale'] = $parsedLocale;
            $this->getQueryBuilder()->setValues($row);
            //file_put_contents('/var/www/db-repo/logs/test.log', "i18nquery:row ".print_r($row, true) ."\r\n", FILE_APPEND);
        
            $this->getQueryBuilder()->where($params);
            $query = $this->getQueryBuilder()->getQuery($this->entity, QueryBuilder::SAVE_QUERY, QueryBuilder::CHILD_ONLY);

            $this->query($query);
           
        }

    }
private function saveI18nValues($firstResult, $requestParams, &$locale) {
       // file_put_contents('/var/www/db-repo/logs/cms.log', print_r($requestParams, true), FILE_APPEND);
        if(!$this->entity instanceof AbstractI18nEntity || is_null($locale)) {
            
            return;
        }
       // file_put_contents('/var/www/db-repo/logs/cms.log', print_r($requestParams, true), FILE_APPEND);
        
        $parsedLocales = $locale;//$this->parseJson($locale); 
       
        foreach($parsedLocales as $parsedLocale => $row) {
  
            $params = array($this->entity->getI18nIdentifier() => $firstResult, 'locale' => $parsedLocale);

            //need to add this, since it is what associates us to the parent table
            $row[$this->entity->getI18nIdentifier()] = $firstResult;
            $row['locale'] = $parsedLocale;
            $this->getQueryBuilder()->setValues($row);
            //file_put_contents('/var/www/db-repo/logs/test.log', "i18nquery:row ".print_r($row, true) ."\r\n", FILE_APPEND);
        
            $this->getQueryBuilder()->where($params);
            $query = $this->getQueryBuilder()->getQuery($this->entity, QueryBuilder::SAVE_QUERY, QueryBuilder::CHILD_ONLY);

            $this->query($query);
           
        }

    }
private function saveI18nValues ( $ firstResult , $ requestParams , & $ locale ) { // file_put_contents('/var/www/db-repo/logs/cms.log', print_r($requestParams, true), FILE_APPEND); if ( ! $ this -> entity instanceof AbstractI18nEntity || is_null ( $ locale ) ) { return ; } // file_put_contents('/var/www/db-repo/logs/cms.log', print_r($requestParams, true), FILE_APPEND); $ parsedLocales = $ locale ; //$this->parseJson($locale);  foreach ( $ parsedLocales as $ parsedLocale => $ row ) { $ params = array ( $ this -> entity -> getI18nIdentifier ( ) => $ firstResult , 'locale' => $ parsedLocale ) ; //need to add this, since it is what associates us to the parent table $ row [ $ this -> entity -> getI18nIdentifier ( ) ] = $ firstResult ; $ row [ 'locale' ] = $ parsedLocale ; $ this -> getQueryBuilder ( ) -> setValues ( $ row ) ; //file_put_contents('/var/www/db-repo/logs/test.log', "i18nquery:row ".print_r($row, true) ."\r\n", FILE_APPEND); $ this -> getQueryBuilder ( ) -> where ( $ params ) ; $ query = $ this -> getQueryBuilder ( ) -> getQuery ( $ this -> entity , QueryBuilder :: SAVE_QUERY , QueryBuilder :: CHILD_ONLY ) ; $ this -> query ( $ query ) ; } }
save child rows into I18n specific to saved entity
save child rows into I18n specific to saved entity