That is pretty much it - you'd just need to tinker with `$em->getClassMetadataFactory()->getAllMetadata()` and the `ClassMetadata#getAssociationNames()` method
Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/ On Sun, Apr 9, 2017 at 12:17 AM, Michael Krasnow <[email protected]> wrote: > The closest I got was listing fields that have foreign keys to other > entities, I couldn't find a method or combination of methods to do the > opposite. > > $em = \ORM::entityManager(); > $class = $em->getClassMetadata('\Entity\File\File'); > var_dump($class->getAssociationNames()); > > > On Friday, April 7, 2017 at 10:55:43 PM UTC-4, Marco Pivetta wrote: >> >> No, just try out some stuff with that first (it's all documented in >> `ClassMetadata.php`). >> >> >> On 8 Apr 2017 4:53 a.m., "Michael Krasnow" <[email protected]> wrote: >> >>> Thanks for pointing that out to me, I am looking over the docs for it. >>> I found getAssociationMappings() and it returns a ton of info, but it >>> doesn't seem to be the info I need >>> >>> Would it be possible to get a basic example? >>> >>> Thanks >>> On Friday, April 7, 2017 at 10:27:16 PM UTC-4, Marco Pivetta wrote: >>>> >>>> Using the ClassMetadata API, this should be trivial. What have you >>>> tried so far? >>>> >>>> On 8 Apr 2017 4:23 a.m., "Michael Krasnow" <[email protected]> wrote: >>>> >>>>> Hi all, >>>>> >>>>> I have a need to find all entities that have foreign keys to a >>>>> specific Entity. >>>>> I searched around but could not find any leads. >>>>> >>>>> This is all using MYSQL as the database. >>>>> >>>>> Thanks >>>>> >>>>> -- >>>>> 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 [email protected]. >>>>> To post to this group, send email to [email protected]. >>>>> 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 [email protected]. >>> To post to this group, send email to [email protected]. >>> 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 [email protected]. > To post to this group, send email to [email protected]. > 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 [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/doctrine-user. For more options, visit https://groups.google.com/d/optout.
