private function writeTable( $dir, $tableName, ezcDbSchemaTable $table )
    {
        $file = $this->openFile( $dir, $tableName );

        fwrite( $file, "\$def = new ezcPersistentObjectDefinition();\n" );
        fwrite( $file, "\$def->table = '$tableName';\n" );
        fwrite( $file, "\$def->class = '{$this->prefix}$tableName';\n" );

        $primaries = $this->determinePrimaries( $table->indexes );

        // fields 
        foreach ( $table->fields as $fieldName => $field )
        {
            $this->writeField( $file, $fieldName, $field, isset( $primaries[$fieldName] ) );
        }
        $this->closeFile( $file );
    }
private function writeTable( $dir, $tableName, ezcDbSchemaTable $table )
    {
        $file = $this->openFile( $dir, $tableName );

        fwrite( $file, "\$def = new ezcPersistentObjectDefinition();\n" );
        fwrite( $file, "\$def->table = '$tableName';\n" );
        fwrite( $file, "\$def->class = '{$this->prefix}$tableName';\n" );

        $primaries = $this->determinePrimaries( $table->indexes );

        // fields 
        foreach ( $table->fields as $fieldName => $field )
        {
            $this->writeField( $file, $fieldName, $field, isset( $primaries[$fieldName] ) );
        }
        $this->closeFile( $file );
    }
private function writeTable ( $ dir , $ tableName , ezcDbSchemaTable $ table ) { $ file = $ this -> openFile ( $ dir , $ tableName ) ; fwrite ( $ file , "\$def = new ezcPersistentObjectDefinition();\n" ) ; fwrite ( $ file , "\$def->table = '$tableName';\n" ) ; fwrite ( $ file , "\$def->class = '{$this->prefix}$tableName';\n" ) ; $ primaries = $ this -> determinePrimaries ( $ table -> indexes ) ; // fields  foreach ( $ table -> fields as $ fieldName => $ field ) { $ this -> writeField ( $ file , $ fieldName , $ field , isset ( $ primaries [ $ fieldName ] ) ) ; } $ this -> closeFile ( $ file ) ; }
Writes the PersistentObject defintion for a table.

This method writes the PersistentObject definition for a single database
table. It creates a new file in the given directory, named in the format
<table_name>.php, writes the start of the definition to it and calls the
{@link ezcDbschemaPersistentWriter::writeField()} method for each of the
database fields.

The defition files always contain an object instance $def, which is
returned in the end.

@param string $dir              The directory to write the defititions to.
@param string $tableName        Name of the database table.
@param ezcDbSchemaTable $table  The table definition.
Writes the PersistentObject defintion for a table .