brunnofoggia/doctrine-dashes 问题修复 & 功能扩展

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

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

brunnofoggia/doctrine-dashes

Composer 安装命令:

composer require brunnofoggia/doctrine-dashes

包简介

This is an additional active record pack for DBAL Integration. It will provide all is needed to connect with a database, read and persist relational data quick and easy.

README 文档

README

Minimum PHP Version License

This is an additional active record pack for DBAL Integration. It will provide all is needed to connect with a database, read and persist relational data quick and easy

Version notice

This works for DBAL ^2.5

What this plugin provides?

Features for Model

  • Persist methods - save, update, create, delete, deleteAll
  • Retrieve methods - get, find, exists
  • Persist related data methods - saveBelongsTo, saveHasMany, saveHasAndBelongsToMany
  • Retrieve related data methods - getRelated, getBelongsTo, getHasMany, getHasAndBelongsToMany
  • Properties available for customization: table, primaryKey, foreignKeys[], fieldsFormat[], recursive

Installation

You should install this with composer. Read the VCS repo docs. A initial composer.json would looks like:

{
  "require": {
      "doctrine/dbal": "^2.5",
      "brunnofoggia/doctrine-dashes": "@dev"
  }
}

Usage

  1. Import it into classes that will use it

    class Sample_model {

     use \doctrine\Dashes\Model;
     protected $table = 'sample';
    

    }

  2. Get an instance of the model

    2.1. Setting connection config before

     \Sample_model::setConnConfig('default', [
         'host' => 'localhost',
         'user' => 'root',
         'pass' => '123',
         'dbname' => 'test'
     ]);
     $test = new Sample_model;
    

    2.2. Sending connection config

     $test = new Sample_model([
         'host' => 'localhost',
         'user' => 'root',
         'pass' => '123',
         'dbname' => 'test'
     ]);
    
  3. try to read a record

     $pk = 1;
     $test->get($pk);
    

Detailed documentation

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-01-23

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固