Created
April 5, 2019 06:16
-
-
Save stepansib/8cb20c2adc56cc37ce8d8c807d505daa to your computer and use it in GitHub Desktop.
#oro get entity attachments
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @Route("/attach", name="crm_debug_attach") | |
*/ | |
public function attachAction(Request $request) | |
{ | |
$this->checkAdmin(); | |
$project = $this->getEntityManager()->getRepository(Project::class)->find(65); | |
$entityClass = $this->get('oro_entity.routing_helper')->resolveEntityClass(Project::class); | |
$entityField = ExtendHelper::buildAssociationName($entityClass); | |
VarDumper::dump( | |
$this->getEntityManager()->getRepository(Attachment::class)->findBy([ | |
$entityField => $project->getId(), | |
])); | |
die(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment