开发者

Schema inheritance with propel1.5

开发者 https://www.devze.com 2023-02-16 05:50 出处:网络
I have developed my little own framework, which depends on some model classes. I am using the framework on different projects, but with side effect that project-related changes in the framew开发者_Sta

I have developed my little own framework, which depends on some model classes. I am using the framework on different projects, but with side effect that project-related changes in the framew开发者_StackOverflow社区ork are not committed to one "single" framework code, but the changes lost for the other projects.

Now I want to outsource the framework code to one single place and symlink in my projects to that code. So that I am using one model in the framework I have a schema.xml for the framework. In the projects I need also schema.xml files for project-related models. In one project I need to extend generated classes of the framework model.

Is there a way to extend a schema.xml file, so that the propel_generator can generate correct sql file and model classes?

Or is there any workaround / better way for such issues?


I guess that you could use the <external-schema> element and split your schema into the "common" part and the "project specific" part (containing an <external-schema> element pointing to the "common" schema).

See Propel doc : http://www.propelorm.org/wiki/Documentation/1.5/Schema#external-schemaelement


I had a leck of understanding of the terminology "domain models". I wanted to use the models created by propel not only as domain model but also as application model. But this would be wrong. I will use the <external-schema> feature to divide my domain model into different parts, but I need to create a "application model" layer to encapsulate the domain model from the rest of the world ;)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号