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

Added support for abstract entities #56

Merged
merged 2 commits into from
Mar 28, 2017
Merged

Added support for abstract entities #56

merged 2 commits into from
Mar 28, 2017

Conversation

jmfeurprier
Copy link
Contributor

This is an attempt to support abstract entities. Feel free to review, ask for modifications / give recommendations, as I primarily tried to fix the issues I personally encountered with abstract entity graphs.

src/Mapping.php Outdated
*/
private $mapping = [];
private $classMetadatas = [];
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I took the liberty of renaming $this->mapping into $this->classMetadatas as it is a private property containing class metadatas within a "Mapping" class, which was misleading. This can be reverted.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem, you were right

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you can just rename to classMetadataList instead of classMetadatas (I find the final "s" not really easy to read)

@jdeniau
Copy link
Member

jdeniau commented Mar 25, 2017

Great thank you, I will look at it quickly

src/Mapping.php Outdated
*/
private $mapping = [];
private $classMetadatas = [];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem, you were right

src/Mapping.php Outdated
*/
private $mapping = [];
private $classMetadatas = [];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you can just rename to classMetadataList instead of classMetadatas (I find the final "s" not really easy to read)

*/
private function resolveRealClassName(array $data, $className)
{
if (!empty($data['@type'])) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think, this is a very tight to an hydra API and api-platform in specific, from whom I try to separate.

Another problem here is if you have different namespaces but the same "entityShortName", then you will have bugs.

but as a matter of fact, your "todo" is probably a good way to solve this for now. I think we can detect the Classmetadata with an IRI and then detect the real class name.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is now changed to retrieve the real class name from the IRI (@id field).

@jmfeurprier
Copy link
Contributor Author

Requested changes were applied : we now rely on the IRI to retrieve the real class name. I also renamed $classMetadatas into $classMetadataList.

@jdeniau jdeniau merged commit e3abe10 into mapado:master Mar 28, 2017
@jdeniau
Copy link
Member

jdeniau commented Mar 28, 2017

tagged as v0.21.0

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

Successfully merging this pull request may close these issues.

None yet

2 participants