Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notice: Undefined index: CURLOPT_HTTPHEADER #45

Open
ianitsky opened this issue Mar 7, 2017 · 0 comments
Open

Notice: Undefined index: CURLOPT_HTTPHEADER #45

ianitsky opened this issue Mar 7, 2017 · 0 comments

Comments

@ianitsky
Copy link

ianitsky commented Mar 7, 2017

How can I reproduce it?

I made the proposed configurations, but I only got this error:

An exception occurred while executing 'SELECT t0.id AS id_1, t0.name AS name_2 FROM customer t0 WHERE t0.id = ?' with params [1]:

Notice: Undefined index: CURLOPT_HTTPHEADER

My doctrine config : (I'm using the AcreedIntegratorBundle)

doctrine:
    dbal:
        default_connection: mysql
        types:
            json: Sonata\Doctrine\Types\JsonType
        connections:
            mysql:
                driver:   pdo_mysql
                host:     "%database_host%"
                port:     "%database_port%"
                dbname:   "%database_name%"
                user:     "%database_user%"
                password: "%database_password%"
                charset:  UTF8
            rest:
                driver_class: "Circle\\DoctrineRestDriver\\Driver"
                host:     "%default_api_url%"
                port:     "%default_api_port%"
                user:     "%default_api_user%"
                password: "%default_api_password%"
                options:
                    format:                         "json"
                    authenticator_class:            "HttpAuthentication"
                    CURLOPT_CURLOPT_FOLLOWLOCATION: true
                    CURLOPT_HEADER:                 true

    orm:
        default_entity_manager: mysql
        auto_generate_proxy_classes: "%kernel.debug%"
        entity_managers:
            mysql:
                connection: mysql
                naming_strategy: doctrine.orm.naming_strategy.underscore
                mappings:
                    AppBundle: ~
            rest:
                connection: rest
                naming_strategy: doctrine.orm.naming_strategy.underscore
                mappings:
                    AcreedIntegratorBundle: ~

Entity:

<?php

namespace AcreedIntegratorBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * Customer
 * @ORM\Entity
 * @ORM\Table(name="customer")
 */
class Customer
{
    /**
     * @var int
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @var string
     *
     * @ORM\Column(name="name", type="string", length=255)
     */
    private $name;


    /**
     * Get id
     *
     * @return int
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set name
     *
     * @param string $name
     *
     * @return Customer
     */
    public function setName($name)
    {
        $this->name = $name;

        return $this;
    }

    /**
     * Get name
     *
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }
}

And my Controller action:

    /**
     * @Route("/test", name="test")
     */
    public function indexAction()
    {
        $em       = $this->getDoctrine()->getManager('rest');
        $entity = $em->getRepository('AcreedIntegratorBundle:Customer')->find(1);

        return new Response($entity->getName());
    }
@ianitsky ianitsky mentioned this issue Mar 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant