1

I'm trying to create Doctrine services for an API in Apigility (1.4.1). Doctrine is installed, along with the Apigility integration.

My configuration (/config/autoload/local.php) is as follows.

return [
    'doctrine' => [
        'connection' => [
            'orm_default' => [
                'driverClass' => 'Doctrine\DBAL\Driver\PDOMySql\Driver',
                'params' => [
                    'host' => 'redacted',
                    'port' => '3306',
                    'user' => 'redacted',
                    'password' => 'redacted',
                    'dbname' => 'redacted',
                    'driverOptions' => [
                        PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8'
                    ],
                ],
            ],
        ],
        'driver' => [
            'default_annotation_driver' => [
                'class' => 'Doctrine\\ORM\\Mapping\\Driver\\AnnotationDriver',
                'paths' => [
                    0 => __DIR__ . '/../../module/Trusts/src/V1/Entity',
                ],
            ],
            'orm_default' => [
                'drivers' => [
                    'Trusts\\V1\\Entity' => 'default_annotation_driver',
                ],
            ],
        ],
    ],
];

At /module/Trusts/src/V1/Entity I have a bunch of entity files, all of which have the following namespace.

namespace Trusts\V1\Entity;

However, when I go to create the services in the Apigility Admin UI, I click 'New service', then 'Doctrine Connected', then select 'doctrine.entitymanager.orm_default' and instead of being able to select an entity, just get an ambiguous message 'Error getting Doctrine service(s).'

I have read through all the (scarce) documentation and guidance I can find on this through Apigility on Github, but had come up with no solution. Can anyone give me any pointers?

Max Griffin
  • 439
  • 2
  • 5
  • 11

1 Answers1

2

this problem is a very simple problem. I practically did not believe it was that simple.

To solve my problem I changed that.

[before]

php -S 0.0.0.0:8080 -t public

[after]

php -S 0.0.0.0:8080 -t public/ public/index.php