Skip to content

Ability to generate extended classes and modify return types #10

Description

@GoogleCodeExporter
You discourage modifying the generated classes, since if you have to 
generate them again the changes will be lost. However, if I create a class 
that extends a generated class I'd have to modify the return types of the 
generated class to the extended type for it to be of any use. 

Say I generated a class of a products table, called PHP2DB_Products. Then 
I create a class specified as MyProducts extends PHP2DB_Products. The 
MyProducts class contains a method called CalculatePrice. The following 
code would fails, since the return type of the findById method is 
PHP2DB_Products.

$prod = MyProducts::findById($db, $eventersId);
echo $prod->CalculatePrice();

Casting is not an option since that would mean I'd have to upcast, which 
is not safe.

It would be nice of the plug-in would generate both the entity classes 
from the database tables and extended classes that people can use to 
program their own logic. The entity classes could then return the extended 
types.

Original issue reported on code.google.com by baskooij...@gmail.com on 18 Nov 2009 at 11:02

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions