承接 basteyy/medoo-orm 相关项目开发

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

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

basteyy/medoo-orm

Composer 安装命令:

composer require basteyy/medoo-orm

包简介

An ORM Mapper for using Medoo as an Object-ORM Tool

README 文档

README

Hi! This is (my personal) Medoo ORM Mapping-Class for mapping the database based on Medoo into classes.

CC BY-SA 4.0

Setup

Use composer to add the Mapper to your code:

composer require basteyy/medoo-orm

Config

There are a few ways to config this.

Create the Medoo-Instance by yourself

You can create the medoo instance somewhere in your code and than load the tables by passing it:

$config = []; // Config 
$medoo = new \Medoo\Medoo($config);
$usersTable = new UsersTable($medoo);

Use Dependency Injection

Create a definition somewhere in your code and simple call the tables:

$DI->addDefinitions([
    \Medoo\Medoo::class => function () {
        $config = []; // Config 
        return new \Medoo\Medoo($config);
    }, 
    // OR (!!)
    'connection' =>  => function () {
        $config = []; // Config 
        return new \Medoo\Medoo($config);
    }, 
    // OR (!!) 
    'DB' =>  => function () {
        $config = []; // Config 
        return new \Medoo\Medoo($config);
    },  
    // OR (!!)
    'DatabaseConnection' =>  => function () {
        $config = []; // Config 
        return new \Medoo\Medoo($config);
    }
]);

Passing the config as a array

You can simple pass the config as an array to the tables and let the script doing the instance-job:

$config = []; // The Config
$usersTable = new FancyTableClassTable($config);

License

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

CC BY-SA 4.0

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: CC-BY-NC-SA-4.0
  • 更新时间: 2021-10-10

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固