PHPZlc & Symfony PHPZlc & Symfony
  • 首页 
  • 文档 
  • 博客 
  • 联系我们 
  • 登录 注册
PHPZlc & Symfony PHPZlc & Symfony
登录 注册
PHPZlc & Symfony
  • 首页 
  • 文档 
  • 博客 
  • 联系我们 
  • SnapshotBusiness
loading
  1. 首页
  2. 文档
  3. 业务组件
  4. SnapshotBusiness
更新于 2023-03-21 12:03:59
  • SnapshotBusiness

快照组件(snapshot-business)

编辑

功能介绍

快照组件,在数据库中便捷的设置读取自定义参数。

源码地址

phpzlc/snapshot-business

安装

composer require phpzlc/snapshot-business

安装完成后执行更新数据库的操作

php bin/console doctrine:schema:update --force

使用

use App\Business\SnapshotBusiness\SnapshotBusiness;

$snapshotBusiness = new SnapshotBusiness($this->container);

//写入
$snapshotBusiness->setValue('key', 1);

//读取 如果没有设置key或者设置的值为空,则返回第二个参数"默认值"
$snapshotBusiness->getValue('key', 1);

//是否设置key
$snapshotBusiness->hasKey('key');
支持
Symfony 5.4
CONTENTS
Links
gitee github composer
视频教程
Leaf Illustration

皖ICP备17026196号-3 34020302000197号

© All Rights Reserved by PHPZlc