protected function loadCollaction($name, $entityName, $fields)
    {
        $em = $this->getContainer()->get('doctrine')->getManager();
        $entityRepository = $em->getRepository($entityName);

        $meta = $em->getClassMetadata($entityName);
        $identifier = $meta->getSingleIdentifierFieldName();
        $identifierMethodName = 'get'.ucfirst($identifier);

        $collection = $entityRepository->findAll();

        $result = array();

        foreach ($collection as $item) {
            $element = array();

            foreach ($fields as $fieldName => $attributes) {
                $methodName = 'get'.ucfirst($fieldName);
                $fieldValue = $item->$methodName();

                $value = null;

                if (is_object($fieldValue)) {
                    if (get_class($fieldValue) === 'DateTime') {
                        $value = array('type' => 'DateTime', 'name' => $fieldValue->format('r'));
                    } elseif (array_key_exists('targetEntity', $attributes)) {
                        $targetClassName = $meta->associationMappings[$fieldName]['targetEntity'];
                        $targetEntityProvider = new EntityProvider($targetClassName);

                        $targetMethodName = 'get'.ucfirst($em->getClassMetadata($targetClassName)->identifier[0]);
                        $value = array(
                            'type' => 'reference',
                            'name' => $targetEntityProvider->getName().'_'.$fieldValue->$targetMethodName(),
                        );
                    } else {
                        throw new \Exception('aaa');
                    }
                } else {
                    $value = $fieldValue;
                }

                $element[$fieldName] = $value;
            }

            $result[$name.'_'.$item->$identifierMethodName()] = $element;
        }

        return $result;
    }