src/Gossamer/Pesedget/Commands/GetCommand.php
private function loadI18nValues(&$firstResult, $params) {
        if (!$this->entity instanceof AbstractI18nEntity) {

            return;
        }
        $filter = array($this->entity->getI18nIdentifier() => $firstResult[0]['id']);
        $localesKey = 'locales';

        if (is_array($params) && array_key_exists('locale', $params)) {
            $filter['locale'] = $params['locale'];
            $localesKey = $params['locale'];
        }

        $this->getQueryBuilder()->where($filter);
        $query = $this->getQueryBuilder()->getQuery($this->entity, QueryBuilder::GET_ALL_ITEMS_QUERY, QueryBuilder::CHILD_ONLY);

        $i18nResult = $this->query($query);
        //file_put_contents('/var/www/shoppingcart/logs/test.log', '$i18nResult: '.print_r($i18nResult,true)."\r\n", FILE_APPEND);

        if ($localesKey == 'locales') {
            $firstResult[0]['locales'] = $this->getLocaleKeys($i18nResult, $this->getI18nValuesForPadding());
        } else {
            $firstResult[0]['locales'][$localesKey] = $i18nResult;
        }
    }
private function loadI18nValues(&$firstResult, $params) {
        if (!$this->entity instanceof AbstractI18nEntity) {

            return;
        }
        $filter = array($this->entity->getI18nIdentifier() => $firstResult[0]['id']);
        $localesKey = 'locales';

        if (is_array($params) && array_key_exists('locale', $params)) {
            $filter['locale'] = $params['locale'];
            $localesKey = $params['locale'];
        }

        $this->getQueryBuilder()->where($filter);
        $query = $this->getQueryBuilder()->getQuery($this->entity, QueryBuilder::GET_ALL_ITEMS_QUERY, QueryBuilder::CHILD_ONLY);

        $i18nResult = $this->query($query);
        //file_put_contents('/var/www/shoppingcart/logs/test.log', '$i18nResult: '.print_r($i18nResult,true)."\r\n", FILE_APPEND);

        if ($localesKey == 'locales') {
            $firstResult[0]['locales'] = $this->getLocaleKeys($i18nResult, $this->getI18nValuesForPadding());
        } else {
            $firstResult[0]['locales'][$localesKey] = $i18nResult;
        }
    }
private function loadI18nValues ( & $ firstResult , $ params ) { if ( ! $ this -> entity instanceof AbstractI18nEntity ) { return ; } $ filter = array ( $ this -> entity -> getI18nIdentifier ( ) => $ firstResult [ 0 ] [ 'id' ] ) ; $ localesKey = 'locales' ; if ( is_array ( $ params ) && array_key_exists ( 'locale' , $ params ) ) { $ filter [ 'locale' ] = $ params [ 'locale' ] ; $ localesKey = $ params [ 'locale' ] ; } $ this -> getQueryBuilder ( ) -> where ( $ filter ) ; $ query = $ this -> getQueryBuilder ( ) -> getQuery ( $ this -> entity , QueryBuilder :: GET_ALL_ITEMS_QUERY , QueryBuilder :: CHILD_ONLY ) ; $ i18nResult = $ this -> query ( $ query ) ; //file_put_contents('/var/www/shoppingcart/logs/test.log', '$i18nResult: '.print_r($i18nResult,true)."\r\n", FILE_APPEND); if ( $ localesKey == 'locales' ) { $ firstResult [ 0 ] [ 'locales' ] = $ this -> getLocaleKeys ( $ i18nResult , $ this -> getI18nValuesForPadding ( ) ) ; } else { $ firstResult [ 0 ] [ 'locales' ] [ $ localesKey ] = $ i18nResult ; } }
load child rows from I18n specific to requested entity
load child rows from I18n specific to requested entity