Discussion:
[doctrine-user] Composite primary key for Shopware REST-API
Conny Tigerspice
2018-03-20 07:07:59 UTC
Permalink
Hi (:

I'm currently trying to make a REST-API in Shopware work which has a
composite primary key:

/**
* @ORM\Id
* @ORM\Column(name="c_group", type="string")
*/
private $cGroup;

/**
* @ORM\Id
* @ORM\Column(name="manufacturer", type="string")
*/
private $manufacturer;

/**
* @ORM\Id
* @ORM\Column(name="a_group", type="string")
*/
private $aGroup;


Unfortunately, if I try to perform a GET, I get the error:
"Error message: Single id is not allowed on composite primary key in entity
PluginName\\Models\\ClassName"

I've already contacted the Shopware Developer Support and they told me that
this is a bug in Doctrine. Is this true?

I'm grateful for any help!

Best,
Conny
--
You received this message because you are subscribed to the Google Groups "doctrine-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to doctrine-user+***@googlegroups.com.
To post to this group, send email to doctrine-***@googlegroups.com.
Visit this group at https://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/d/optout.
Marco Pivetta
2018-03-20 09:10:59 UTC
Permalink
Doctrine simply reports a logical error in an attempt to perform a lookup
via partial identifier, that's all.

Not a bug in the ORM (unless a test case proves otherwise): the exception
was thrown by the ORM due to a detected non-respected invariant.

Marco Pivetta

http://twitter.com/Ocramius

http://ocramius.github.com/

On Tue, Mar 20, 2018 at 8:07 AM, Conny Tigerspice <
Post by Conny Tigerspice
I'm currently trying to make a REST-API in Shopware work which has a
/**
*/
private $cGroup;
/**
*/
private $manufacturer;
/**
*/
private $aGroup;
"Error message: Single id is not allowed on composite primary key in
entity PluginName\\Models\\ClassName"
I've already contacted the Shopware Developer Support and they told me
that this is a bug in Doctrine. Is this true?
I'm grateful for any help!
Best,
Conny
--
You received this message because you are subscribed to the Google Groups
"doctrine-user" group.
To unsubscribe from this group and stop receiving emails from it, send an
Visit this group at https://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "doctrine-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to doctrine-user+***@googlegroups.com.
To post to this group, send email to doctrine-***@googlegroups.com.
Visit this group at https://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/d/optout.
Conny Tigerspice
2018-03-20 09:15:03 UTC
Permalink
Thank you very much!

Then I'll tell Shopware that there is something wrong with their software.
Post by Marco Pivetta
Doctrine simply reports a logical error in an attempt to perform a lookup
via partial identifier, that's all.
Not a bug in the ORM (unless a test case proves otherwise): the exception
was thrown by the ORM due to a detected non-respected invariant.
Marco Pivetta
http://twitter.com/Ocramius
http://ocramius.github.com/
Post by Conny Tigerspice
I'm currently trying to make a REST-API in Shopware work which has a
/**
*/
private $cGroup;
/**
*/
private $manufacturer;
/**
*/
private $aGroup;
"Error message: Single id is not allowed on composite primary key in
entity PluginName\\Models\\ClassName"
I've already contacted the Shopware Developer Support and they told me
that this is a bug in Doctrine. Is this true?
I'm grateful for any help!
Best,
Conny
--
You received this message because you are subscribed to the Google Groups
"doctrine-user" group.
To unsubscribe from this group and stop receiving emails from it, send an
<javascript:>.
Visit this group at https://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "doctrine-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to doctrine-user+***@googlegroups.com.
To post to this group, send email to doctrine-***@googlegroups.com.
Visit this group at https://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/d/optout.
Loading...