baka/database
Composer 安装命令:
composer require baka/database
包简介
Baka Databse component
README 文档
README
Baka Database
Model
The default behavior of the baka model is giving you the normal functions to work with any mc project
- automatic updated_at , created_at times
- soft delete by just calling softDelete() insted of delete()
- toFullArray() instead of toArray() to avoid dynamic fields on your model been removed by phalcon serialization
- Custom Fields Trait and CLI
- Hash Table Traits for dynamic atributes
Custom Fields Model
One of the things we look for is a table that growth in a vertical way instead of horizontal . We made custom fields to avoid having to go later on in proyect and having to add new fields to the table, with this we can managed them dynamicly and later on add UI for the client to better manage the info
To create a custom fields table from a module you will need to use our CLI
To use you need your model to extend from ModelCustomFields
<?php namespace Canvas\Models; class Leads extends \Baka\Database\Model { use CustomFieldsTrait; }
And you also need to create the custom fields model value
<?php namespace Canvas\Models; use \Baka\Database\CustomeFieldsInterface; class LeadsCustomFields extends \Baka\Database\Model implements CustomeFieldsInterface { /** * Set the custom primary field id * * @param int $id */ public function setCustomId(int $id) { $this->leads_id = $id; } }
Thats it now you can use this custom fields model like any other, no other explication is needed they will work like any phalcon normal model
Hash Tables
Like its name implies, you have a table with key value for any entity you desire. This is usefull when you need to add settings to any tables in your system
<?php namespace Canvas\Models; class Leads extends \Baka\Database\Model { use HashTableTrait; }
baka/database 适用场景与选型建议
baka/database 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 8.13k 次下载、GitHub Stars 达 1, 最近一次更新时间为 2018 年 02 月 22 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 baka/database 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 baka/database 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 8.13k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 1
- 依赖项目数: 4
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-02-22