Skip to content
This repository has been archived by the owner on Dec 1, 2021. It is now read-only.

When a key annotation is specified on a class property, the property name can't be used in findBy anymore. #165

Open
TSchuermans opened this issue Nov 10, 2017 · 0 comments

Comments

@TSchuermans
Copy link
Contributor

Since RC 8 we have the ability to specify a key annotation on a class property so you can use specific coding conventions for your property names and store them in another format in neo4j.

For instance:

/**
 * @OGM\Property(type="string", key="last_update")
 */
protected $lastUpdate;

When you create a node using this class, the value of the $lastUpdate property gets saved as "last_update", the same way Doctrine uses the name annotation on its entities.

name: By default the property name is used for the database column name also, however the ‘name’ attribute allows you to determine the column name.

But if you'd like to find a node using the findBy repository method, you can only use the "last_update" key, not the property name.
Someone suggested that it should be possible to use both.

This works:
$repository->findOneBy(['last_update' => $value]);

This doesn't:
$repository->findOneBy(['lastUpdate' => $value]);

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant