find('Jobtype',0); die(); foreach ($product->getTasktypesRel()->getValues() as $product) { var_dump( $product->getName()); } exit; $jobtypes = new Jobtypes(); $jobtypes->setName('мойщик окон'); $productRepository = $entityManager->getRepository('Accounts')->findOneBy(['id' => 27 ] ); //var_dump(get_class($productRepository));die(); $jobtypes->addAcoountJobtypes($productRepository); $entityManager->persist($jobtypes); $entityManager->flush(); //foreach ($productRepository as $value) { //} //$jobtypes = new Jobtypes(); $accounts = new Account(); $id = 1;//$argv[1]; //$product = $entityManager->find('Accounts',1); // Вывод списка многие ко многим //$product = $entityManager->find('Jobtypes',21); $productRepository = $entityManager->getRepository('Section'); $products = $productRepository->findAll(); var_dump(empty($products)); foreach ($products as $product) { var_dump( $product->getName()); var_dump($product->getLocomotiveSeries()); $ty = $product->getDateStartRepair(); var_dump($ty->getTimestamp()); } */