定制 icanboogie/bind-facets 二次开发

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

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

icanboogie/bind-facets

最新稳定版本:v5.0.0

Composer 安装命令:

composer require icanboogie/bind-facets

包简介

Binds icanboogie/facets to ICanBoogie

README 文档

README

Release Build Status Code Quality Code Coverage Packagist

The icanboogie/bind-facets package binds icanboogie/facets to ICanBoogie, using its autoconfig feature, and provides the following features:

  • A synthesizer for the activerecord_facets config.
  • A criteria prototype property for Model instances.
  • A criterion_list prototype property for Model instances.
  • A fetch_record() prototype method for Model instances.
  • A fetch_records() prototype method for Model instances.

Hinting prototype bindings

Because most features are provided through prototype methods, your favorite editor might complain about unknown methods, in which case simply use the ModelBindings trait.

The following example demonstrates how to hint your code about a fetch_records method. Notice the type hint in the annotation Model|ModelBindings:

<?php

use ICanBoogie\ActiveRecord\Model;
use ICanBoogie\Binding\Facets\ModelBindings;
use ICanBoogie\Facets\RecordCollection;

/**
 * @param Model|ModelBindings
 *
 * @return RecordCollection
 */
function fetch(Model $model, array $conditions)
{
    return $model->fetch_records($conditions;
}

Requirements

The package requires PHP 7.2 or later.

Installation

composer require icanboogie/bind-facets

Documentation

The package is documented as part of the ICanBoogie framework documentation. You can generate the documentation for the package and its dependencies with the make doc command. The documentation is generated in the build/docs directory. ApiGen is required. The directory can later be cleaned with the make clean command.

Testing

Run make test-container to create and log into the test container, then run make test to run the test suite. Alternatively, run make test-coverage to run the test suite with test coverage. Open build/coverage/index.html to see the breakdown of the code coverage.

License

icanboogie/bind-facets is released under the New BSD License.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2015-03-15