承接 taitava/silverstripe-dataview 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

taitava/silverstripe-dataview

Composer 安装命令:

composer require taitava/silverstripe-dataview

包简介

Creates MySQL views automatically during dev/build .

README 文档

README

This module allows you to create MySQL views that are automatically built and updated during the /dev/build process (or via a separate BuildTask, if you prefer not to do this during /dev/build).

Example:

class MyView extends DataView
{
	public static function getViewStatement()
        {
        	//Borrow SQL from a DataList:
        	return MyDataObject::get()->filter('SoftDeleted', false);
        	
        	//Custom SQL:
        	return new SQLSelect(['Book.Title','Author.Name'],'Book')->addLeftJoin('Author','Book.AuthorID = Author.ID');
        	
        	//The quick and dirty way: hard coded SQL:
        	return 'SELECT quantity, price, quantity*price AS amount FROM Product';
        }
}

Now just run /dev/build in your browser or php framework/cli-script.php dev/tasks/UpdateDataViewsTask in terminal. Now you have your new view defined in the database. Note that you do need to gave CREATE VIEW and DROP VIEW permissions in the database! DROP VIEW is mandatory for updating the structure of existing views.

Unfortunately this module does not currently offer any method to read data from views, but I'm planning to do some research to determine what would be the most meaningful way to achieve this.

Roadmap

For version 1.0 I would like this module to have:

  • DataList style way to filter and iterate records from views
  • DataObject style way to read properties from records (no write ability. Writing should be done through regular DataObjects or custom SQL commands)
  • Support for SilverStripe 4.x
  • A better documentation
  • Probably something more...

Contribution

If you have any ideas about how to improve this module or any questions, I would be glad to hear them! :) Please raise an issue or create a pull request - which ever you like.

统计信息

  • 总下载量: 106
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-08-29

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固