new Annotated\Embeddings($classLocator), // Recognize embeddable entities
new Annotated\Entities($classLocator), // Identify attributed entities
the variable $classLocator is set with new \Spiral\Tokenizer\ClassLocator($finder) but Annotated\Embeddings is expected an instance of EmbeddingLocatorInterface and Annotated\Entities is expected an instance of EntityLocatorInterface.
To solve this problem I wrote the following code but I am not sure it is the good solution:
new Annotated\Embeddings(new Annotated\Locator\TokenizerEmbeddingLocator($classLocator)),
new Annotated\Entities(new Annotated\Locator\TokenizerEntityLocator($classLocator)),
Still in section "Compiling the Schema" there is :
use Doctrine\Common\Annotations\AnnotationRegistry;
// Initialize annotations
AnnotationRegistry::registerLoader('class_exists');
I have a fresh symfony7.0 install without doctrine (because I want to use Cycle) so this namespace doesn't exist. I removed these lines of code and it seems that it is still working good because I was able to persist my entity.
Also the code related to "With the schema compiled, it can be integrated into the ORM:" has a conflict with Cycle\Schema namespace. this solve the conflict :
//I removed use Cycle\ORM\Schema;
$orm = new ORM\ORM(new ORM\Factory($dbal), new ORM\Schema($schema));
No duplicates 🥲.
Database
MySQL
What happened?
Hello
I am interested to use Cycle ORM so I followed the install doc : https://cycle-orm.dev/docs/intro-install/current/en#step-1-install-the-orm but I ran into some issues. At section "Compiling the Schema" the code example shows :
the variable
$classLocator
is set withnew \Spiral\Tokenizer\ClassLocator($finder)
butAnnotated\Embeddings
is expected an instance ofEmbeddingLocatorInterface
andAnnotated\Entities
is expected an instance ofEntityLocatorInterface
.To solve this problem I wrote the following code but I am not sure it is the good solution:
Still in section "Compiling the Schema" there is :
I have a fresh symfony7.0 install without doctrine (because I want to use Cycle) so this namespace doesn't exist. I removed these lines of code and it seems that it is still working good because I was able to persist my entity.
Also the code related to "With the schema compiled, it can be integrated into the ORM:" has a conflict with
Cycle\Schema
namespace. this solve the conflict :Version