承接 roydejong/php-activerecord-utils 相关项目开发

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

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

roydejong/php-activerecord-utils

Composer 安装命令:

composer require roydejong/php-activerecord-utils

包简介

Utilities for composing queries in php-activerecord.

README 文档

README

Simple utilities that make writing php-activerecord queries more convenient.

Latest Stable Version Build Status License

Getting started

Add this library as a Composer dependency:

composer require roydejong/php-activerecord-utils

Once included, you'll be able to autoload the desired classes from the ActiveRecordUtils\ namespace.

Conditions

ActiveRecordUtils\Composers\Conditions lets you elegantly compose readable conditions parameters for activerecord queries.

Basic usage

<?php

use ActiveRecordUtils\Composers\Conditions;

Conditions::make()
    ->where('employee_id = ?', 123)
    ->or('login_id = ?', 123)
    ->andWhere('is_enabled = 1')
    ->value();

// Returns: ["(employee_id = ? OR login_id = ?) AND (is_enabled = 1)", 123, 123]

Features

  • 📝 Better syntax: Programmatically compose your WHERE clauses with a syntax that's easier to read and more convenient to maintain.
  • Easy grouping: Use andWhere(), orWhere() to start a new parentheses group, or use and(), or() to add another condition to he current group.
  • Auto validation: Issues like wrong parameter count are automatically detected and produce convenient and readable error messages.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-08-28