我正在使用symfony将XML插入数据库中。我已经踏上了XML之旅,现在我需要学习如何将XML存储在表中,而无需咨询。
foreach ($matchInfo->children() as $matchOfficials) {
foreach ($matchOfficials->attributes() as $key => $value) {
$arbitro = 0;
$row = 0;
while ($row = $arbitro->$row) {
$arbitro = new Arbitro();
$arbitro->setNombre($arbitro['FirstName']);
$arbitro->setApellido($arbitro['LastName']);
$arbitro->setUid($arbitro['Uid']);
$entityManager->persist($arbitro);
}
$entityManager->flush();
}
}