src/core/framework/core/3rdparty/ezcomponents/DatabaseSchema/src/handlers/persistent/writer.php
private function writeField( $file, $fieldName, $field, $isPrimary )
    {
        fwrite( $file, "\n" );
        if ( $isPrimary )
        {
            fwrite( $file, "\$def->idProperty               = new ezcPersistentObjectIdProperty();\n" );
            fwrite( $file, "\$def->idProperty->columnName   = '$fieldName';\n" );
            fwrite( $file, "\$def->idProperty->propertyName = '$fieldName';\n" );
            if ( $field->autoIncrement )
            {
                fwrite( $file, "\$def->idProperty->generator    = new ezcPersistentGeneratorDefinition( 'ezcPersistentSequenceGenerator' );\n" );
            }
            else
            {
                fwrite( $file, "\$def->idProperty->generator    = new ezcPersistentGeneratorDefinition( 'ezcPersistentManualGenerator' );\n" );
                fwrite( $file, "\$def->idProperty->propertyType = ezcPersistentObjectProperty::PHP_TYPE_STRING;\n" );
            }
        }
        else
        {
            fwrite( $file, "\$def->properties['$fieldName']               = new ezcPersistentObjectProperty();\n" );
            fwrite( $file, "\$def->properties['$fieldName']->columnName   = '$fieldName';\n" );
            fwrite( $file, "\$def->properties['$fieldName']->propertyName = '$fieldName';\n" );
            fwrite( $file, "\$def->properties['$fieldName']->propertyType = {$this->translateType($field->type)};\n" );
        }
        fwrite( $file, "\n" );
    }
private function writeField( $file, $fieldName, $field, $isPrimary )
    {
        fwrite( $file, "\n" );
        if ( $isPrimary )
        {
            fwrite( $file, "\$def->idProperty               = new ezcPersistentObjectIdProperty();\n" );
            fwrite( $file, "\$def->idProperty->columnName   = '$fieldName';\n" );
            fwrite( $file, "\$def->idProperty->propertyName = '$fieldName';\n" );
            if ( $field->autoIncrement )
            {
                fwrite( $file, "\$def->idProperty->generator    = new ezcPersistentGeneratorDefinition( 'ezcPersistentSequenceGenerator' );\n" );
            }
            else
            {
                fwrite( $file, "\$def->idProperty->generator    = new ezcPersistentGeneratorDefinition( 'ezcPersistentManualGenerator' );\n" );
                fwrite( $file, "\$def->idProperty->propertyType = ezcPersistentObjectProperty::PHP_TYPE_STRING;\n" );
            }
        }
        else
        {
            fwrite( $file, "\$def->properties['$fieldName']               = new ezcPersistentObjectProperty();\n" );
            fwrite( $file, "\$def->properties['$fieldName']->columnName   = '$fieldName';\n" );
            fwrite( $file, "\$def->properties['$fieldName']->propertyName = '$fieldName';\n" );
            fwrite( $file, "\$def->properties['$fieldName']->propertyType = {$this->translateType($field->type)};\n" );
        }
        fwrite( $file, "\n" );
    }
private function writeField ( $ file , $ fieldName , $ field , $ isPrimary ) { fwrite ( $ file , "\n" ) ; if ( $ isPrimary ) { fwrite ( $ file , "\$def->idProperty               = new ezcPersistentObjectIdProperty();\n" ) ; fwrite ( $ file , "\$def->idProperty->columnName   = '$fieldName';\n" ) ; fwrite ( $ file , "\$def->idProperty->propertyName = '$fieldName';\n" ) ; if ( $ field -> autoIncrement ) { fwrite ( $ file , "\$def->idProperty->generator    = new ezcPersistentGeneratorDefinition( 'ezcPersistentSequenceGenerator' );\n" ) ; } else { fwrite ( $ file , "\$def->idProperty->generator    = new ezcPersistentGeneratorDefinition( 'ezcPersistentManualGenerator' );\n" ) ; fwrite ( $ file , "\$def->idProperty->propertyType = ezcPersistentObjectProperty::PHP_TYPE_STRING;\n" ) ; } } else { fwrite ( $ file , "\$def->properties['$fieldName']               = new ezcPersistentObjectProperty();\n" ) ; fwrite ( $ file , "\$def->properties['$fieldName']->columnName   = '$fieldName';\n" ) ; fwrite ( $ file , "\$def->properties['$fieldName']->propertyName = '$fieldName';\n" ) ; fwrite ( $ file , "\$def->properties['$fieldName']->propertyType = {$this->translateType($field->type)};\n" ) ; } fwrite ( $ file , "\n" ) ; }
Write a field of the schema to the PersistentObject definition.
This method writes a database field to the PersistentObject definition
file.

@param resource(file) $file    The file to write to.
@param string $fieldName       The name of the field.
@param ezcDbSchemaField $field The field object.
@param bool $isPrimary         Whether the field is the primary key.
Write a field of the schema to the PersistentObject definition . This method writes a database field to the PersistentObject definition file .