public function importCustomOrderStatus() { // Assume Thelia status are the same up to ID #5 $hdl = $this->t1db->query("select * from statut where id > ?", array(5)); while ($hdl && ($statut = $this->t1db->fetch_object($hdl))) { $ct = new OrderStatus(); $descs = $this->t1db->query_list("select * from statutdesc where statut = ? order by lang asc", array($statut->id)); foreach ($descs as $desc) { $lang = $this->getT2Lang($desc->lang); $ct->setCode(strtolower($statut->nom))->setLocale($lang->getLocale())->setTitle($desc->titre)->setChapo($desc->chapo)->setDescription($desc->description)->save(); } } }