定制 iofficedk/mybasemodel 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

iofficedk/mybasemodel

Composer 安装命令:

composer require iofficedk/mybasemodel

包简介

extend your PHP model

README 文档

README

With myBaseModel you can extends your own models and get some extra query functions. It is meant to be simple and NOT laravel illuminate. :) I used to use it first in a project to quickly getting a "working" model to show if a framework are not choosen yet and in small scripts.

Using

Setup .io.json with the section

{
    "mysql": {
        "default": {
            "host": "localhost",
            "user": "",
            "pass": "",
            "base": "",
            "port": "3306"
        }
    }
}
namespace App\Model;

Class Users extends \Io\Model\Base\myBaseModel
{
    protected $table = 'user';
}

Single call :

$User = Users::new()
$User = Users::id({row id})
$User = Users::sql({query})

Multi call

::where({field}, {Operator}, {value})
::whereOr({field}, {Operator}, {value})
::fields([{field name}])
::sort({field name DESC|ASC})

ex. $Users = Users::where('active', 'IS NOT NULL')->fields('name')->sort('name DESC');

Resource

$Users->count()
$Users->next()
$Users->getArray()    

Result

$User = $Users->next()

$User->{fieldname}
$User->isReady()
$User->getId()
$User->getObject()

$Status = $User->save()
$Status = $User->delete()

ex. $User = $Users->next()
if ($User)
{
    return $User->name;
}

Saving | Deleting

$Status->success
$Status->updated
$Status->created
$Status->matched
$Status->warning
$Status->error

Install

$ composer require iofficedk/mybasemodel

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-02-18

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固