/** * Save data to product export table, create new row if not exists * * @throws \LogicException * * @return Edit */ protected function _saveProductExport() { if (!$this->_product) { throw new \LogicException('Cannot edit product export info as no product is set'); } $this->_trans->add("\n\t\t\tINSERT INTO\n\t\t\t\tproduct_export\n\t\t\t\t(\n\t\t\t\t\tproduct_id,\n\t\t\t\t\tlocale,\n\t\t\t\t\texport_value,\n\t\t\t\t\texport_description,\n\t\t\t\t\texport_manufacture_country_id,\n\t\t\t\t\texport_code\n\t\t\t\t)\n\t\t\tVALUES\n\t\t\t\t(\n\t\t\t\t\t:productID?i,\n\t\t\t\t\t:locale?sn,\n\t\t\t\t\t:exportValue?fn,\n\t\t\t\t\t:exportDescription?sn,\n\t\t\t\t\t:exportCountryID?s,\n\t\t\t\t\t:exportCode?sn\n\t\t\t\t)\n\t\t\tON DUPLICATE KEY UPDATE\n\t\t\t\texport_value\t\t\t\t\t= :exportValue?fn,\n\t\t\t\texport_description\t\t\t\t= :exportDescription?sn,\n\t\t\t\texport_manufacture_country_id\t= :exportCountryID?s,\n\t\t\t\texport_code = :exportCode?sn\n\t\t", ['productID' => $this->_product->id, 'locale' => $this->_locale->getID(), 'exportValue' => $this->_product->exportValue, 'exportDescription' => $this->_product->exportDescription, 'exportCountryID' => $this->_product->exportManufactureCountryID, 'exportCode' => $this->_product->getExportCode()]); return $this; }
public function __construct(Locale $locale) { $this->_locale = $locale; $this->pricing[$locale->getID()] = []; }
public function testGettingFallback() { $locale = new Locale('en_US', 'en_GB'); $this->assertSame('en_GB', $locale->getFallback()); }