Zend_CodeGenerator_Php_File can be used to generate the
contents of a PHP file. You can include classes as well as arbitrary
content body. When attaching classes, you should attach either
concrete Zend_CodeGenerator_Php_Class instances or an
array defining the class.

In the example below, we will assume you've defined
$foo per one of the class definitions in a previous
example.

You may add code to an existing class. To do so, first use the
static fromReflection() method to map the class into a
generator object. From there, you may add additional properties or
methods, and then regenerate the class.