/** * @When /^los siguientes centros:$/ */ public function losSiguientesCentros(TableNode $table) { foreach ($table->getHash() as $row) { $faculty = new Faculty(); $faculty->setName($row['nombre']); $faculty->setSlug($row['código']); $faculty->setIsEnabled($row['activo'] === 'sí'); $this->getEntityManager()->persist($faculty); } $this->getEntityManager()->flush(); }