private function CreateSchemaFile($table)
 {
     $namespace = $this->FullNamespace($table);
     $class = $this->ClassName($table);
     $schemaClass = $this->SchemaClassName($table);
     $file = $schemaClass . '.php';
     $writer = new Php\Writer();
     $writer->StartPhp();
     $writer->AddNamespace($namespace);
     $writer->AddNamespaceUse('Phine\\Framework\\Database\\Objects', 'DBObjects');
     $writer->AddNamespaceUse('Phine\\Framework\\Database\\Sql');
     $writer->StartDocComment();
     $writer->AddDocComment("Represents the schema of the database entity '" . $this->GetNiceName($class)) . "'";
     $writer->EndDocComment();
     $writer->StartClass($schemaClass, 'DBObjects\\TableSchema');
     $this->AddSchemaConstructor($writer, $schemaClass);
     $this->AddSchemaSingleton($writer, $schemaClass);
     $this->AddSchemaTableName($writer, $table);
     $this->AddSchemaConnection($writer, $class);
     $this->AddSchemaCreateInstance($writer, $class);
     $this->AddSchemaFieldMappers($writer, $table);
     $this->AddSchemaBysAndFetches($writer, $table);
     $writer->EndClass();
     $this->CreateFile($file, $writer->Text(), $this->NamespaceSubFolder($table));
 }