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

Exclusion policy for entity relationships #266

Closed
drgomesp opened this issue Feb 6, 2013 · 1 comment
Closed

Exclusion policy for entity relationships #266

drgomesp opened this issue Feb 6, 2013 · 1 comment

Comments

@drgomesp
Copy link

drgomesp commented Feb 6, 2013

Hi!

I have two entities, with @ManyToOne relationship between them.

class Customer
{
    /**
     * @ORM\OneToMany(targetEntity="ContactSubmission", mappedBy="customer")
     */
    private $contactSubmissions;
}
class ContactSubmission
{
    /**
     * @ORM\ManyToOne(targetEntity="Customer", inversedBy="contactSubmissions", cascade={"persist"})
     * @ORM\JoinColumn(name="customerId", referencedColumnName="id")
     */
    private $customer;
}

My exclusion policy works great for one of them, but the relational entity fields are not being excluded according to their policies.

This is what I have for the exclusion policy:

MyNamespace\MyBundle\Entity\ContactSubmission:
    exclusion_policy: ALL
    properties:
        customer:
            expose: true
            type: MyNamespace\MyBundle\Entity\Customer
        subject:
            expose: true
        message:
            expose: true
        date:
            expose: true

Is there anyway I can set a field to represent that relationship or something like that?

@schmittjoh
Copy link
Owner

Please use the Symfony2 mailing list for usage questions.

Thanks!

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

2 participants