// Generated by Haxe 4.3.1
package code;

import haxe.root.*;

@SuppressWarnings(value={"rawtypes", "unchecked"})
public class PhpCode extends haxe.lang.HxObject
{
	static
	{
		//line 10 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
		{
			//line 10 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
			java.lang.Object __temp_odecl2 = null;
			//line 10 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
			{
				//line 10 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
				java.lang.Object __temp_odecl1 = new haxe.lang.DynamicObject(new java.lang.String[]{"SuppressWarnings"}, new java.lang.Object[]{new haxe.root.Array(new java.lang.Object[]{"checkstyle:CyclomaticComplexity"})}, new java.lang.String[]{}, new double[]{});
				//line 10 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
				__temp_odecl2 = new haxe.lang.DynamicObject(new java.lang.String[]{"generateMethods"}, new java.lang.Object[]{__temp_odecl1}, new java.lang.String[]{}, new double[]{});
			}
			
			//line 10 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
			code.PhpCode.__meta__ = new haxe.lang.DynamicObject(new java.lang.String[]{"statics"}, new java.lang.Object[]{__temp_odecl2}, new java.lang.String[]{}, new double[]{});
		}
		
	}
	
	public PhpCode(haxe.lang.EmptyObject empty)
	{
	}
	
	
	public PhpCode()
	{
		//line 10 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
		code.PhpCode.__hx_ctor_code_PhpCode(this);
	}
	
	
	protected static void __hx_ctor_code_PhpCode(code.PhpCode __hx_this)
	{
	}
	
	
	public static java.lang.Object __meta__;
	
	public static haxe.ds.StringMap<java.lang.String> generate(model.Diagram diagram)
	{
		//line 12 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
		haxe.ds.StringMap<java.lang.String> files = new haxe.ds.StringMap<java.lang.String>();
		//line 13 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
		{
			//line 13 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
			java.lang.Object set = diagram.iterator();
			//line 13 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
			while (haxe.lang.Runtime.toBool(((java.lang.Boolean) (haxe.lang.Runtime.callField(set, "hasNext", null)) )))
			{
				//line 13 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
				model.Set set1 = ((model.Set) (haxe.lang.Runtime.callField(set, "next", null)) );
				//line 14 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
				if ((  ! (haxe.root.Std.isOfType(set1, model.Association.class))  || (((model.Association) (set1) )).isClass() )) 
				{
					//line 15 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
					files.set(( set1.className + ".php" ), code.PhpCode.generateClass(set1));
				}
				
			}
			
		}
		
		//line 18 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
		return files;
	}
	
	
	public static java.lang.String generateClass(model.Set set)
	{
		//line 22 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
		java.lang.String content = "<?php\n";
		//line 23 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
		content += code.PhpCode.addImports(set);
		//line 24 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
		if (set.isInterface) 
		{
			//line 25 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
			content += ( ( ( "interface " + set.className ) + (( (set.isGeneric()) ? ("<T>") : ("") )) ) + " {\n" );
		}
		else
		{
			//line 27 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
			content += ( ( ( ( (( (set.isAbstract) ? ("abstract ") : ("") )) + "class " ) + set.className ) + (( (( set.superset != null )) ? (( "extends " + set.superset.className )) : ("") )) ) + " {\n" );
		}
		
		//line 30 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
		content += code.PhpCode.generateFields(set);
		//line 31 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
		content += code.PhpCode.generateConstructors(set);
		//line 32 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
		content += code.PhpCode.generateMethods(set);
		//line 33 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
		content += "}\n?>\n";
		//line 34 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
		return content;
	}
	
	
	public static java.lang.String addImports(model.Set set)
	{
		//line 38 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
		haxe.root.Array<java.lang.String> imports = new haxe.root.Array<java.lang.String>();
		//line 39 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
		{
			//line 39 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
			{
				//line 39 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
				haxe.root.Array<model.Field> fields = set.fields;
				//line 40 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
				{
					//line 40 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
					int _g = 0;
					//line 40 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
					while (( _g < fields.length ))
					{
						//line 40 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
						model.Field field = fields.__get(_g);
						//line 40 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
						 ++ _g;
						//line 41 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
						java.lang.String classType = ( (( haxe.lang.StringExt.indexOf(field.classType, "Array", null) == 0 )) ? (haxe.lang.StringExt.substring(field.classType, 6, ( field.classType.length() - 1 ))) : (field.classType) );
						//line 42 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
						if (( ( ( ( ((int) (haxe.lang.Runtime.toInt(haxe.lang.StringExt.charCodeAt(code.PhpCode.getType(classType), 0))) ) <= 90 ) &&  ! (haxe.lang.Runtime.valEq(classType, set.className))  ) &&  ! (haxe.lang.Runtime.valEq(code.PhpCode.getType(classType), "DateTime"))  ) &&  ! (haxe.lang.Runtime.toBool(((java.lang.Boolean) (haxe.root.Lambda.has(((java.lang.Object) (imports) ), haxe.lang.Runtime.toString(( ( "require_once(\'" + classType ) + ".php\');" )))) )))  )) 
						{
							//line 44 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
							imports.push(( ( "require_once(\'" + classType ) + ".php\');" ));
						}
						
					}
					
				}
				
			}
			
			//line 39 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
			{
				//line 39 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
				haxe.root.Array<model.Field> fields1 = set.navFields;
				//line 40 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
				{
					//line 40 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
					int _g1 = 0;
					//line 40 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
					while (( _g1 < fields1.length ))
					{
						//line 40 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
						model.Field field1 = fields1.__get(_g1);
						//line 40 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
						 ++ _g1;
						//line 41 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
						java.lang.String classType1 = ( (( haxe.lang.StringExt.indexOf(field1.classType, "Array", null) == 0 )) ? (haxe.lang.StringExt.substring(field1.classType, 6, ( field1.classType.length() - 1 ))) : (field1.classType) );
						//line 42 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
						if (( ( ( ( ((int) (haxe.lang.Runtime.toInt(haxe.lang.StringExt.charCodeAt(code.PhpCode.getType(classType1), 0))) ) <= 90 ) &&  ! (haxe.lang.Runtime.valEq(classType1, set.className))  ) &&  ! (haxe.lang.Runtime.valEq(code.PhpCode.getType(classType1), "DateTime"))  ) &&  ! (haxe.lang.Runtime.toBool(((java.lang.Boolean) (haxe.root.Lambda.has(((java.lang.Object) (imports) ), haxe.lang.Runtime.toString(( ( "require_once(\'" + classType1 ) + ".php\');" )))) )))  )) 
						{
							//line 44 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
							imports.push(( ( "require_once(\'" + classType1 ) + ".php\');" ));
						}
						
					}
					
				}
				
			}
			
		}
		
		//line 48 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
		if (( ( set.superset != null ) &&  ! (haxe.lang.Runtime.toBool(((java.lang.Boolean) (haxe.root.Lambda.has(((java.lang.Object) (imports) ), haxe.lang.Runtime.toString(( ( "require_once(\'" + set.superset.className ) + ".php\');" )))) )))  )) 
		{
			//line 49 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
			imports.push(( ( "require_once(\'" + set.superset.className ) + ".php\');" ));
		}
		
		//line 51 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
		java.lang.String content = ( imports.join("\n") + "\n\n" );
		//line 52 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
		return content;
	}
	
	
	public static java.lang.String generateFields(model.Set set)
	{
		//line 56 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
		java.lang.String content = "";
		//line 57 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
		{
			//line 57 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
			{
				//line 57 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
				haxe.root.Array<model.Field> fields = set.fields;
				//line 58 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
				{
					//line 58 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
					int _g = 0;
					//line 58 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
					while (( _g < fields.length ))
					{
						//line 58 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
						model.Field field = fields.__get(_g);
						//line 58 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
						 ++ _g;
						//line 59 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
						content += ( ( ( ( ( ( "\t" + (( (( field.visibility == model.Field.ACCESS_PRIVATE )) ? ("private ") : (( (( field.visibility == model.Field.ACCESS_PROTECTED )) ? ("protected ") : ("public ") )) )) ) + (( (field.isStatic) ? ("static ") : ("") )) ) + code.PhpCode.getType(field.classType) ) + " $" ) + field.className ) + ";\n" );
					}
					
				}
				
			}
			
			//line 57 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
			{
				//line 57 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
				haxe.root.Array<model.Field> fields1 = set.navFields;
				//line 58 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
				{
					//line 58 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
					int _g1 = 0;
					//line 58 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
					while (( _g1 < fields1.length ))
					{
						//line 58 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
						model.Field field1 = fields1.__get(_g1);
						//line 58 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
						 ++ _g1;
						//line 59 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
						content += ( ( ( ( ( ( "\t" + (( (( field1.visibility == model.Field.ACCESS_PRIVATE )) ? ("private ") : (( (( field1.visibility == model.Field.ACCESS_PROTECTED )) ? ("protected ") : ("public ") )) )) ) + (( (field1.isStatic) ? ("static ") : ("") )) ) + code.PhpCode.getType(field1.classType) ) + " $" ) + field1.className ) + ";\n" );
					}
					
				}
				
			}
			
		}
		
		//line 64 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
		return content;
	}
	
	
	public static java.lang.String generateMethods(model.Set set)
	{
		//line 69 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
		java.lang.String content = "";
		//line 70 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
		{
			//line 70 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
			int _g = 0;
			//line 70 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
			haxe.root.Array<haxe.root.Array<model.Method>> _g1 = new haxe.root.Array<haxe.root.Array<model.Method>>(new haxe.root.Array[]{set.accessors, set.methods});
			//line 70 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
			while (( _g < _g1.length ))
			{
				//line 70 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
				haxe.root.Array<model.Method> methods = _g1.__get(_g);
				//line 70 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
				 ++ _g;
				//line 71 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
				{
					//line 71 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
					int _g2 = 0;
					//line 71 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
					while (( _g2 < methods.length ))
					{
						//line 71 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
						model.Method method = methods.__get(_g2);
						//line 71 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
						 ++ _g2;
						//line 72 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
						java.lang.String content1 = ( ( ( ( ( "\n\t" + (( (( method.visibility == model.Field.ACCESS_PRIVATE )) ? ("private ") : (( (( method.visibility == model.Field.ACCESS_PROTECTED )) ? ("protected ") : ("public ") )) )) ) + (( (method.isStatic) ? ("static ") : ("") )) ) + "function " ) + method.className ) + "(" );
						//line 75 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
						haxe.root.Array<java.lang.String> _g3 = new haxe.root.Array<java.lang.String>(new java.lang.String[]{});
						//line 75 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
						{
							//line 75 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
							java.lang.Object x = ((java.lang.Object) (haxe.lang.Runtime.callField(((java.lang.Object) (method.params) ), "iterator", null)) );
							//line 75 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
							while (haxe.lang.Runtime.toBool(((java.lang.Boolean) (haxe.lang.Runtime.callField(x, "hasNext", null)) )))
							{
								//line 75 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
								model.Field x1 = ((model.Field) (haxe.lang.Runtime.callField(x, "next", null)) );
								//line 75 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
								_g3.push(( ( code.PhpCode.getType(x1.classType) + " $" ) + x1.className ));
							}
							
						}
						
						//line 72 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
						content += ( ( ( ( content1 + _g3.join(", ") ) + ")" ) + (( (haxe.lang.Runtime.valEq(method.classType, "")) ? ("") : (( ": " + code.PhpCode.getType(method.classType) )) )) ) + " {\n" );
						//line 77 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
						if (( haxe.lang.Runtime.valEq(haxe.lang.StringExt.substr(method.className, 0, 3), "get") || haxe.lang.Runtime.valEq(haxe.lang.StringExt.substr(method.className, 0, 3), "set") )) 
						{
							//line 78 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
							model.Field field = set.getFieldCode(code.Code.extractFieldName(method.className, null));
							//line 79 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
							if (( field != null )) 
							{
								//line 80 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
								if (haxe.lang.Runtime.valEq(haxe.lang.StringExt.substr(method.className, 0, 3), "set")) 
								{
									//line 81 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
									content += ( ( ( ( "\t\t$this->" + field.className ) + " = $" ) + field.className ) + ";\n" );
								}
								
								//line 83 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
								if (haxe.lang.Runtime.valEq(haxe.lang.StringExt.substr(field.classType, 0, 5), "Array")) 
								{
									//line 84 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
									content += ( ( "\t\treturn $this->" + field.className ) + "->clone();\n" );
								}
								else
								{
									//line 86 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
									content += ( ( "\t\treturn $this->" + field.className ) + ";\n" );
								}
								
							}
							
						}
						else
						{
							//line 89 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
							if (( ( method.params.length == 1 ) && (( haxe.lang.Runtime.valEq(haxe.lang.StringExt.substr(method.className, 0, 3), "add") || haxe.lang.Runtime.valEq(haxe.lang.StringExt.substr(method.className, 0, 6), "remove") )) )) 
							{
								//line 90 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
								model.Field field1 = set.getFieldFromArrayType(method.params.__get(0).classType);
								//line 91 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
								if (( field1 != null )) 
								{
									//line 92 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
									content += ( ( ( ( "\t\t$this->" + field1.className ) + (( (haxe.lang.Runtime.valEq(haxe.lang.StringExt.substr(method.className, 0, 3), "add")) ? ("->add(") : ("->remove(") )) ) + method.params.__get(0).className ) + ");\n" );
									//line 94 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
									content += "\t\treturn $this;\n";
								}
								
							}
							else
							{
								//line 96 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
								if ( ! (haxe.lang.Runtime.valEq(method.classType, "")) ) 
								{
									//line 97 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
									content += ( ( "\t\treturn " + code.Code.getDefaultValue(method.classType, "[]", null) ) + ";\n" );
								}
								
							}
							
						}
						
						//line 99 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
						content += "\t}\n";
					}
					
				}
				
			}
			
		}
		
		//line 102 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
		return content;
	}
	
	
	public static java.lang.String generateConstructors(model.Set set)
	{
		//line 106 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
		java.lang.String content = "";
		//line 107 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
		{
			//line 107 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
			int _g = 0;
			//line 107 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
			haxe.root.Array<model.Method> _g1 = set.constructors;
			//line 107 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
			while (( _g < _g1.length ))
			{
				//line 107 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
				model.Method method = _g1.__get(_g);
				//line 107 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
				 ++ _g;
				//line 108 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
				haxe.root.Array<java.lang.String> _g2 = new haxe.root.Array<java.lang.String>(new java.lang.String[]{});
				//line 108 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
				{
					//line 108 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
					java.lang.Object x = ((java.lang.Object) (haxe.lang.Runtime.callField(((java.lang.Object) (method.params) ), "iterator", null)) );
					//line 108 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
					while (haxe.lang.Runtime.toBool(((java.lang.Boolean) (haxe.lang.Runtime.callField(x, "hasNext", null)) )))
					{
						//line 108 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
						model.Field x1 = ((model.Field) (haxe.lang.Runtime.callField(x, "next", null)) );
						//line 108 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
						_g2.push(( ( code.PhpCode.getType(x1.classType) + " $" ) + x1.className ));
					}
					
				}
				
				//line 108 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
				content += ( ( "\n\tfunction __construct(" + _g2.join(", ") ) + ") {\n" );
				//line 109 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
				if (( set.superset != null )) 
				{
					//line 110 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
					haxe.root.Array<model.Field> parentFields = ((haxe.root.Array<model.Field>) (((haxe.root.Array) (haxe.root.Lambda.filter(((java.lang.Object) (method.params) ), ((haxe.lang.Function) (new code.PhpCode_generateConstructors_110__Fun(set)) ))) )) );
					//line 111 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
					haxe.root.Array<java.lang.String> _g3 = new haxe.root.Array<java.lang.String>(new java.lang.String[]{});
					//line 111 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
					{
						//line 111 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
						int _g_current = 0;
						//line 111 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
						haxe.root.Array<model.Field> _g_array = parentFields;
						//line 111 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
						while (( _g_current < _g_array.length ))
						{
							//line 111 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
							model.Field x2 = _g_array.__get(_g_current++);
							//line 111 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
							_g3.push(( "$" + x2.className ));
						}
						
					}
					
					//line 111 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
					content += ( ( "\t\tparrent::__construct(" + _g3.join(", ") ) + ");\n" );
				}
				
				//line 113 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
				{
					//line 113 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
					int _g4 = 0;
					//line 113 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
					haxe.root.Array<model.Field> _g5 = method.params;
					//line 113 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
					while (( _g4 < _g5.length ))
					{
						//line 113 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
						model.Field param = _g5.__get(_g4);
						//line 113 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
						 ++ _g4;
						//line 114 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
						model.Field field = set.getFieldCode(param.className);
						//line 115 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
						if (( field != null )) 
						{
							//line 116 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
							content += ( ( ( ( "\t\t$this->" + field.className ) + " = $" ) + param.className ) + ";\n" );
						}
						
					}
					
				}
				
				//line 119 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
				{
					//line 119 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
					{
						//line 119 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
						haxe.root.Array<model.Field> fields = set.fields;
						//line 120 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
						{
							//line 120 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
							int _g6 = 0;
							//line 120 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
							while (( _g6 < fields.length ))
							{
								//line 120 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
								model.Field field1 = fields.__get(_g6);
								//line 120 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
								 ++ _g6;
								//line 121 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
								if ((  ! (field1.isStatic)  &&  ! (haxe.lang.Runtime.toBool(((java.lang.Boolean) (haxe.root.Lambda.exists(((java.lang.Object) (method.params) ), ((haxe.lang.Function) (new code.PhpCode_generateConstructors_121__Fun_0(field1)) ))) )))  )) 
								{
									//line 122 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
									content += ( ( ( ( "\t\t$this->" + field1.className ) + " = " ) + code.Code.getDefaultValue(field1.classType, "[]", null) ) + ";\n" );
								}
								
							}
							
						}
						
					}
					
					//line 119 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
					{
						//line 119 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
						haxe.root.Array<model.Field> fields1 = set.navFields;
						//line 120 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
						{
							//line 120 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
							int _g7 = 0;
							//line 120 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
							while (( _g7 < fields1.length ))
							{
								//line 120 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
								model.Field field2 = fields1.__get(_g7);
								//line 120 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
								 ++ _g7;
								//line 121 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
								if ((  ! (field2.isStatic)  &&  ! (haxe.lang.Runtime.toBool(((java.lang.Boolean) (haxe.root.Lambda.exists(((java.lang.Object) (method.params) ), ((haxe.lang.Function) (new code.PhpCode_generateConstructors_121__Fun(field2)) ))) )))  )) 
								{
									//line 122 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
									content += ( ( ( ( "\t\t$this->" + field2.className ) + " = " ) + code.Code.getDefaultValue(field2.classType, "[]", null) ) + ";\n" );
								}
								
							}
							
						}
						
					}
					
				}
				
				//line 126 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
				content += "\t}\n";
			}
			
		}
		
		//line 128 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
		return content;
	}
	
	
	public static java.lang.String getType(java.lang.String classType)
	{
		//line 132 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
		java.lang.String languageType = classType;
		//line 133 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
		if (haxe.lang.Runtime.valEq(haxe.lang.StringExt.substr(classType, 0, 5), "Array")) 
		{
			//line 134 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
			languageType = ( ( "array/*" + haxe.lang.StringExt.substr(classType, 5, null) ) + "*/" );
		}
		else
		{
			//line 135 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
			if (( ( ( haxe.lang.Runtime.valEq(classType, "Int") || haxe.lang.Runtime.valEq(classType, "Float") ) || haxe.lang.Runtime.valEq(classType, "Double") ) || haxe.lang.Runtime.valEq(classType, "String") )) 
			{
				//line 136 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
				languageType = classType.toLowerCase();
			}
			else
			{
				//line 137 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
				if (( ( haxe.lang.Runtime.valEq(classType, "Date") || haxe.lang.Runtime.valEq(classType, "Time") ) || haxe.lang.Runtime.valEq(classType, "DateTime") )) 
				{
					//line 138 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
					languageType = "DateTime";
				}
				else
				{
					//line 139 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
					if (haxe.lang.Runtime.valEq(classType, "Bool")) 
					{
						//line 140 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
						languageType = "boolean";
					}
					else
					{
						//line 141 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
						if (haxe.lang.Runtime.valEq(classType, "T")) 
						{
							//line 142 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
							languageType = "mixed";
						}
						
					}
					
				}
				
			}
			
		}
		
		//line 144 "/home/frank/Documents/Developpements/dbconcept-0.5.0/src/code/PhpCode.hx"
		return languageType;
	}
	
	
}


