csanquer/custom-base-behavior
Composer 安装命令:
composer require csanquer/custom-base-behavior
包简介
Propel Behavior to customize generated parent Base classes
README 文档
README
License
MIT License
copyright (c) 2012 Charles Sanquer
Functionality
Propel Behavior to customize generated Parent Base classes
The normal propel inheritance with generated base classes follow this schema :
With CustomBaseBehavior you can change the parent classes of the base generated classes and share common methods between model objects
Requirements
This behavior requires Propel >=1.6.0
Installation
You can use composer and packagist.org package csanquer/custom-base-behavior
Or just download and copy the behavior to a specific path.
Then register the behavior class by adding the following to the bottom of the build.properties file in you project folder:
# check that you have behaviors enabled propel.builder.addBehaviors = true # and add the custom behavior propel.behavior.custom_base.class = path.to.CustomBehavior
Enable the behavior in your schema.xml:
<table name="book"> <column name="id" required="true" primaryKey="true" autoIncrement="true" type="INTEGER" /> <column name="title" type="VARCHAR" required="true" /> <behavior name="custom_base"> <parameter name="base_object" value="MyCustomBaseObject" /> <!-- default = "BaseObject" --> <parameter name="base_peer" value="MyCustomBasePeer" /> <!-- default = "" --> <parameter name="base_query" value="MyCustomBaseQuery" /> <!-- default = "ModelCriteria" --> </behavior> </table>
Base classes can use namespaces ( with , / or dot character).
Your custom Base Object class should extend Propel BaseObject and your custom Base Query class should extend Propel ModelCriteria.
Tests
To run tests
curl -s http://getcomposer.org/installer | php
php composer.phar --dev install
phpunit
统计信息
- 总下载量: 583
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2012-07-17

