csanquer/custom-base-behavior 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

csanquer/custom-base-behavior

Composer 安装命令:

composer require csanquer/custom-base-behavior

包简介

Propel Behavior to customize generated parent Base classes

README 文档

README

Build Status

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 :

Normal inheritance schema

With CustomBaseBehavior you can change the parent classes of the base generated classes and share common methods between model objects

Customized inheritance schema

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

GitHub 信息

  • Stars: 4
  • Watchers: 2
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2012-07-17

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固