public static function createFromSQLWithLanguagePrice($db_field) { if (!empty($db_field)) { $item = GameFbProducts::createFromSQL($db_field); if (!empty($item)) { $itemLang = new GameFbProductLanguage(); $itemPrice = new GameFbProductPrices(); $itemLang->setFbProductId($item->getId()); $itemPrice->setFbProductId($item->getId()); if (isset($db_field["langCode"])) { $itemLang->setLanguage($db_field["langCode"]); } if (isset($db_field["langText"])) { $itemLang->setText($db_field["langText"]); } if (isset($db_field["priceCurrency"])) { $itemPrice->setCurrency($db_field["priceCurrency"]); } if (isset($db_field["priceAmount"])) { $itemPrice->setAmount($db_field["priceAmount"]); } if (empty($item->languages)) { $item->languages = array(); } if (empty($item->prices)) { $item->prices = array(); } array_push($item->languages, $itemLang); array_push($item->prices, $itemPrice); return $item; } } return null; }