protected function importTaxes(\PDO $dbh, EntityManager $em) { $count = 0; $sth = $dbh->prepare('SELECT * FROM tax'); $sth->execute(); foreach ($sth->fetchAll(\PDO::FETCH_ASSOC) as $row) { $tax = new Tax(); $tax->setName($row['name']); $tax->setValue($row['value']); $tax->setActive($row['active']); $tax->setIsDefault($row['is_default']); $em->persist($tax); $this->mapping['taxes'][$row['id']] = $tax; $count++; } return $count; }