这是我的插入代码
$checklist = new Report();
$project = $entityManager
->find('Application\Entity\Projects',$projectId);
$level = $entityManager
->find('Application\Entity\LdDynamicLevels',$postArray['level']);
$building = $entityManager
->find('Application\Entity\LdDynamicBuildings',$postArray['building']);
$checklist->setLdDynamicBuilding($building);
$checklist->setLdDynamicLevel($level);
$checklist->setProject($project);
$entityManager->merge($checklist);
$entityManager->flush();
现在的问题是,当我运行它所说的代码时,构建值为null,尽管当转储构建记录时它具有所需的值 此代码适用于 $ building:
$buildingId = Building->getBuildingId();
echo $buildingId;
正在打印该值,这意味着该建筑物不为空 请帮忙