'migrationpro_save_mapping', 'primary' => 'id_mapping', 'fields' => array( 'type' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName', 'required' => true), 'source_id' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt', 'required' => true), 'source_name' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName', 'required' => true), 'local_id' => array('type' => self::TYPE_INT, 'validate' => 'isNullOrUnsignedId') ), ); public static function listMapping($list = false, $keyAsSourceId = false) { $sql = new DbQuery(); $sql->select('*'); $sql->from('migrationpro_save_mapping'); $mappings = array(); $rows = Db::getInstance()->executeS($sql); if (!$list) { return $rows; } if ($keyAsSourceId) { foreach ($rows as $row) { $mappings[$row['type']][$row['source_id']] = $row['local_id']; } } else { foreach ($rows as $row) { $mappings[$row['type']][$row['id_mapping']] = array( 'id_mapping' => $row['id_mapping'], 'source_id' => $row['source_id'], 'source_name' => $row['source_name'], 'local_id' => $row['local_id'] ); } } return $mappings; } }