src/Titon/Db/Behavior/ConverterBehavior.php
public function postFind(Event $event, array &$results, $finder) {
        if (!in_array($finder, ['first', 'all'])) {
            return;
        }

        $repo = $this->getRepository();
        $converters = $this->getConverters();

        foreach ($results as $i => $result) {
            foreach ($result as $key => $value) {
                if (empty($converters[$key])) {
                    continue;
                }

                $converter = $converters[$key];

                // Exit if decoding should not happen
                if (!$converter['decode']) {
                    continue;
                }

                switch ($converter['type']) {
                    case self::SERIALIZE:   $value = $this->fromSerialize($value, $converter); break;
                    case self::JSON:        $value = $this->fromJson($value, $converter); break;
                    case self::BASE64:      $value = $this->fromBase64($value, $converter); break;
                    case self::CUSTOM:
                        if (method_exists($repo, $converter['decode'])) {
                            $value = call_user_func_array([$repo, $converter['decode']], [$value, $converter]);
                        }
                    break;
                }

                $results[$i][$key] = $value;
            }
        }
    }
public function postFind(Event $event, array &$results, $finder) {
        if (!in_array($finder, ['first', 'all'])) {
            return;
        }

        $repo = $this->getRepository();
        $converters = $this->getConverters();

        foreach ($results as $i => $result) {
            foreach ($result as $key => $value) {
                if (empty($converters[$key])) {
                    continue;
                }

                $converter = $converters[$key];

                // Exit if decoding should not happen
                if (!$converter['decode']) {
                    continue;
                }

                switch ($converter['type']) {
                    case self::SERIALIZE:   $value = $this->fromSerialize($value, $converter); break;
                    case self::JSON:        $value = $this->fromJson($value, $converter); break;
                    case self::BASE64:      $value = $this->fromBase64($value, $converter); break;
                    case self::CUSTOM:
                        if (method_exists($repo, $converter['decode'])) {
                            $value = call_user_func_array([$repo, $converter['decode']], [$value, $converter]);
                        }
                    break;
                }

                $results[$i][$key] = $value;
            }
        }
    }
public function postFind ( Event $ event , array & $ results , $ finder ) { if ( ! in_array ( $ finder , [ 'first' , 'all' ] ) ) { return ; } $ repo = $ this -> getRepository ( ) ; $ converters = $ this -> getConverters ( ) ; foreach ( $ results as $ i => $ result ) { foreach ( $ result as $ key => $ value ) { if ( empty ( $ converters [ $ key ] ) ) { continue ; } $ converter = $ converters [ $ key ] ; // Exit if decoding should not happen if ( ! $ converter [ 'decode' ] ) { continue ; } switch ( $ converter [ 'type' ] ) { case self :: SERIALIZE : $ value = $ this -> fromSerialize ( $ value , $ converter ) ; break ; case self :: JSON : $ value = $ this -> fromJson ( $ value , $ converter ) ; break ; case self :: BASE64 : $ value = $ this -> fromBase64 ( $ value , $ converter ) ; break ; case self :: CUSTOM : if ( method_exists ( $ repo , $ converter [ 'decode' ] ) ) { $ value = call_user_func_array ( [ $ repo , $ converter [ 'decode' ] ] , [ $ value , $ converter ] ) ; } break ; } $ results [ $ i ] [ $ key ] = $ value ; } } }
Apply the decoding converter after a record is retrieved.

@param \Titon\Event\Event $event
@param array $results
@param string $finder
Apply the decoding converter after a record is retrieved .