protected function createOrUpdate(CustomerTitleEvent $event, CustomerTitleModel $customerTitle) { $con = Propel::getConnection(CustomerTitleTableMap::DATABASE_NAME); $con->beginTransaction(); $i18n = $customerTitle->getTranslation($event->getLocale(), $con); try { $i18n->setShort($event->getShort())->setLong($event->getLong()); $customerTitle->save($con); if ($event->isDefault()) { $customerTitle->toggleDefault($con); $event->setDefault(false); } $con->commit(); } catch (\Exception $e) { $con->rollBack(); throw $e; } $event->setCustomerTitle($customerTitle); }