public function clear($entityName = null)
{
if ($entityName === null) {
$this->unitOfWork->clear();
} else {
//TODO
throw new ORMException("EntityManager#clear(\$entityName) not yet implemented.");
}
}
/** * @param float $discount */ public function apply($discount) { $this->entityManager->transactional(function () use($discount) { foreach ($this->items->findAll() as $item) { $item->applyDiscount($discount); } }); $this->entityManager->clear(); }