We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
php di config
$containerBuilder->addDefinitions([ Atlas::class => function (ContainerInterface $c) { $settings = $c->get('settings')['atlas']['pdo']; $atlasBuilder = new AtlasBuilder(...$settings); $atlasBuilder->setFactory(function ($class) use ($c) { if ($c->has($class)) { return $c->get($class); } }); return $atlasBuilder->newAtlas(); }, ]);
Repository
class TestRepository { protected $mapper; public function __construct(TestThread $mapper) { $this->mapper = $mapper; } }
Error cannot be resolved: Entry "Atlas\Table\Table" cannot be resolved: the class is not instantiable
The text was updated successfully, but these errors were encountered:
The problem is that you never add the mapper classes to the di definition.
I've a file that looks something like this:
<?php use Atlas\Orm\Atlas; use Psr\Container\ContainerInterface; $mappers = [ TestThread::class, ]; $defs = []; foreach ($mappers as $mapper) { $defs[$mapper] = DI\factory(static function (ContainerInterface $container, string $mapper) { return $container->get(Atlas::class)->mapper($mapper); })->parameter('mapper', $mapper); } return $defs;
By doing it this way we don't initialize any mappers until we needed them
Sorry, something went wrong.
No branches or pull requests
php di config
Repository
Error
cannot be resolved: Entry "Atlas\Table\Table" cannot be resolved: the class is not instantiable
The text was updated successfully, but these errors were encountered: