src/core/framework/core/3rdparty/ezcomponents/DatabaseSchema/src/handlers/persistent/class_writer.php
private function writeClass( $dir, $tableName, ezcDbSchemaTable $table )
    {
        $file = $this->openFile( $dir, $tableName );

        fwrite( $file, "/**\n" );
        fwrite( $file, " * Data class $tableName.\n" );
        fwrite( $file, " * Class to be used with eZ Components PersistentObject.\n" );
        fwrite( $file, " */\n" );
        fwrite( $file, "class {$this->prefix}$tableName\n" );
        fwrite( $file, "{\n" );

        // attributes 
        $this->writeAttributes( $file, $table->fields );
        fwrite( $file, "\n" );

        // methods
        $this->writeSetState( $file );
        fwrite( $file, "\n" );
        $this->writeGetState( $file, $table->fields );

        fwrite( $file, "}\n" );
        $this->closeFile( $file );
    }
private function writeClass( $dir, $tableName, ezcDbSchemaTable $table )
    {
        $file = $this->openFile( $dir, $tableName );

        fwrite( $file, "/**\n" );
        fwrite( $file, " * Data class $tableName.\n" );
        fwrite( $file, " * Class to be used with eZ Components PersistentObject.\n" );
        fwrite( $file, " */\n" );
        fwrite( $file, "class {$this->prefix}$tableName\n" );
        fwrite( $file, "{\n" );

        // attributes 
        $this->writeAttributes( $file, $table->fields );
        fwrite( $file, "\n" );

        // methods
        $this->writeSetState( $file );
        fwrite( $file, "\n" );
        $this->writeGetState( $file, $table->fields );

        fwrite( $file, "}\n" );
        $this->closeFile( $file );
    }
private function writeClass ( $ dir , $ tableName , ezcDbSchemaTable $ table ) { $ file = $ this -> openFile ( $ dir , $ tableName ) ; fwrite ( $ file , "/**\n" ) ; fwrite ( $ file , " * Data class $tableName.\n" ) ; fwrite ( $ file , " * Class to be used with eZ Components PersistentObject.\n" ) ; fwrite ( $ file , " */\n" ) ; fwrite ( $ file , "class {$this->prefix}$tableName\n" ) ; fwrite ( $ file , "{\n" ) ; // attributes  $ this -> writeAttributes ( $ file , $ table -> fields ) ; fwrite ( $ file , "\n" ) ; // methods $ this -> writeSetState ( $ file ) ; fwrite ( $ file , "\n" ) ; $ this -> writeGetState ( $ file , $ table -> fields ) ; fwrite ( $ file , "}\n" ) ; $ this -> closeFile ( $ file ) ; }
Writes a PHP class.
This method writes a PHP class from a table definition.

@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 a PHP class . This method writes a PHP class from a table definition .