Example #1
0
 /**
  * @param ConnectionInterface|null $con
  * @throws \Exception
  * @throws \Propel\Runtime\Exception\PropelException
  */
 public function postActivation(ConnectionInterface $con = null)
 {
     $database = new Database($con);
     $database->insertSql(null, [__DIR__ . DS . 'Config' . DS . 'thelia.sql']);
     $currencies = json_decode(file_get_contents(__DIR__ . DS . 'Config' . DS . 'currency_codes.json'), true);
     $codes = [];
     foreach ($currencies as $currency) {
         if (!$this->isValidCurrency($codes, $currency)) {
             continue;
         }
         $currencyNumericCode = new CurrencyNumericCode();
         $currencyNumericCode->setCode($currency['AlphabeticCode'])->setNumericCode($currency['NumericCode'])->setMinorUnit($currency['MinorUnit'])->save($con);
         $codes[] = $currency['AlphabeticCode'];
     }
     $con->commit();
     $this->deployImageFolder($this->getModuleModel(), __DIR__ . DS . "templates" . DS . "backOffice" . DS . "default" . DS . "assets" . DS . "img", $con);
 }
 /**
  * Exclude object from result
  *
  * @param   ChildCurrencyNumericCode $currencyNumericCode Object to remove from the list of results
  *
  * @return ChildCurrencyNumericCodeQuery The current query, for fluid interface
  */
 public function prune($currencyNumericCode = null)
 {
     if ($currencyNumericCode) {
         $this->addUsingAlias(CurrencyNumericCodeTableMap::CODE, $currencyNumericCode->getCode(), Criteria::NOT_EQUAL);
     }
     return $this;
 }