net_bazzline/php_propel_behavior_create_entity

该软件包已被废弃,不再维护。没有建议替代包。

自由软件的CreateEntity propel行为,简化实体创建

1.2.0 2016-03-06 21:32 UTC

This package is auto-updated.

Last update: 2021-06-28 13:22:23 UTC


README

我喜欢这个想法,但目前没有用例再进一步开发。

Propel的创建实体行为

这个自由软件的行为应该可以简化你的propel查询类中的实体创建。

感谢StateMachineBehavior提供了一个如此优秀的模板。

当前主分支的构建状态由Travis CI跟踪:Build Status Latest stable

scrutinizer状态如下:code quality

versioneye状态如下:dependencies

下载量:Downloads this Month

可在openhub.net找到。

原因

  • 代码中不再需要new
  • 简化测试代码编写(createEntity可以被模拟)

用法

  • 如果你想运行phpunit,请确保已启用extension=pdo_sqlite.so
  • 该行为向表查询类添加了createEntity方法
$query = DemoQuery::create();
//create a new instance of class "Demo" without using new
$entity = $query->createEntity();

安装

手动安装

mkdir -p vendor/net_bazzline/php_propel_behavior_create_entity
cd vendor/net_bazzline/php_propel_behavior_create_entity
git clone https://github.com/bazzline/php_propel_behavior_create_entity

通过Packagist安装

"net_bazzline/php_propel_behavior_create_entity": "dev-master"

在Propel中启用行为

  • 请将以下内容添加到您的propel.ini文件中
propel.behavior.create_entity.class = lib.vendor.net_bazzline.php_propel_behavior_create_entity.source.CreateEntityBehavior
  • 在您的schema.xml中添加使用
<!-- for the whole database -->
<database name="propel" defaultIdMethod="native" package="lib.model">
    <behavior name="create_entity" />
</database>
<!-- for one table -->
<database name="propel" defaultIdMethod="native" package="lib.model">
    <table name="my_table">
        <column name="id" type="INTEGER" required="true" primaryKey="true" autoIncrement="true" />
        <behavior name="create_entity" />
    </table>
</database>

API

API 可在 bazzline.net 上找到

历史

  • 即将推出
    • @待办
    • 添加了“为什么”部分
    • 优化了阅读
  • 1.2.0 - 发布于 2016年3月6日
    • 添加了对 PHP 7.0 的支持
    • 移除了对 PHP 5.3.3 的支持
  • 1.1.4 - 发布于 2016年3月6日
    • 更新了依赖项
  • 1.1.3 - 发布于 2015年1月11日
    • 修复了处理 phpunit 4.8.* 依赖项的问题
  • 1.1.2 - 发布于 2015年12月11日
    • 更新了依赖项
  • 1.1.1 - 发布于 2015年11月7日
    • 更新了依赖项
  • 1.1.0 - 发布于 2015年9月17日
    • 修复了处理命名空间时的问题
  • 1.0.1 - 发布于 2015年8月19日
    • 更新了依赖项
  • 1.0.0 - 发布于 2015年8月2日
    • 初始发布

结语

如果你喜欢,请给它点个赞 :-). 如果需要,请添加问题。如果你喜欢修复补丁,请拉取。如果你使用了它,请写一篇博客。如果你非常喜欢它,请捐赠一些东西 :-]。