承接 thybag/pseudo-model 相关项目开发

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

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

thybag/pseudo-model

最新稳定版本:0.3.0

Composer 安装命令:

composer require thybag/pseudo-model

包简介

PseudoModel is an eloquent like model base for backing on to custom data structures.

README 文档

README

PseudoModel is an eloquent-like base model for laravel, aiming to mirror the majority of the laravels basic model functionality.

Using PseudoModel you can represent and interact with none-database based data in much the same way you would any normal Model, hopefully simplifying the code you need the write. In the past I've used this approach for mapping on to LDAP as well as 3rd party API's.

In order to provide the standard eloquent eventing behaviors, you can use the persist method to define your save logic. The method will change depending on whether the change is create, update or delete.

    /**
     * Persist model changes. Called on save & delete.
     *
     * @param  string $action  create|update|delete
     * @param  array  $options
     * @return boolean true|false
     */
    protected function persist($action, array $options = []): bool
    {
        return true;
    }

This library is still in progress so not yet recommended for use in production.

统计信息

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

GitHub 信息

  • Stars: 2
  • Watchers: 3
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-09-06