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

About ManyToMany relation #6

Open
mikvet opened this issue Mar 10, 2017 · 6 comments
Open

About ManyToMany relation #6

mikvet opened this issue Mar 10, 2017 · 6 comments

Comments

@mikvet
Copy link

mikvet commented Mar 10, 2017

Hello,
great bundle, thanks !
Just a few line to drop a feedback and a question (not really a bug nor a request :)

I have a question ? what is happening on ManyToMany relations ? I have tested this, the relation is not deleted.

class User
{
    /**
     * @var Group[]
     * @ORM\ManyToMany(targetEntity="Sig\MyBundle\Entity\Group", inversedBy="users")
     * @Evence\onSoftDelete(type="CASCADE")
     * @ORM\JoinTable(
     *     name="user_2_group",
     *     joinColumns={@ORM\JoinColumn(name="user_id", referencedColumnName="id", nullable=false, onDelete="CASCADE")},
     *     inverseJoinColumns={@ORM\JoinColumn(name="group_id", referencedColumnName="id", nullable=false, onDelete="CASCADE")}
     * )
     */
    protected $groups;
}

Best regards

Michael

@devnix
Copy link

devnix commented Jun 29, 2017

We have a similar problem in a Many to One relationship. May it be a no implemented part of the bundle? It is a total blocker for my current project.

@RubenHarms
Copy link
Contributor

ManyToMany was not implemented, seems that i forgot that! But it's a simple rule of code, so i'll fix that shortly!

@RubenHarms
Copy link
Contributor

Implementation for ManyMany pushed in 239faa8 @mikvet could you please test this on dev-master?

@RauchF
Copy link

RauchF commented Aug 14, 2017

@RubenHarms thank you for your implementation so far, however I still have a problem:

I have a ManyToMany relationship between a "regular" entity FooBundle\Entity\Qux and a soft-deleteable entity FooBundle\Entity\Bar. Qux, the regular entity, is the owning side of this relation, so that's where the JoinTable is configured.

When I add the onSoftDelete annotation to the inverse property inside the soft-deleteable entity Bar, I get the following error:

No joinTable found for the relationship FooBundle\Entity\Bar

When I add the onSoftDelete annotation to the owning side (inside Qux), I get presented with the following:

No joinColumn found for the relationship between FooBundle\Entity\Bar and FooBundle\Entity\Bar

edit: the relationship in the last error is displayed as being between Bar and Bar, not between Bar and Qux.

@sharif9876
Copy link

I'm having the same issue as @RauchF, ManyToMany not working

@RubenHarms
Copy link
Contributor

RubenHarms commented Aug 7, 2018

@sharif9876 Can you please paste the exact error? And the full implementation?

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

No branches or pull requests

5 participants