jeyroik/extas-repositories-fields-sha1

该包的最新版本(0.1.0)没有可用的许可证信息。

extas 的 Sha1 字段支持

0.1.0 2020-04-09 16:08 UTC

This package is auto-updated.

Last update: 2024-09-18 14:15:39 UTC


README

tests codecov.io

描述

适配器,用于自动使用 sha1 加密值。

建议在提供与包一起的数据且安装时需要加密的情况下使用此适配器。

使用方法

  1. 连接插件并指定标记

extas.json

{
    "plugins": [
        {
            "class": "extas\\components\\plugins\\repositories\\PluginFieldSha1",
            "stage": "extas.<entity>.create.before"
        }
    ],
    "my": [
        {
            "name": "test",
            "value": "@sha1(admin)"
        }
    ]
}
  1. 检查
$item = $myRepo->one(['name' => 'test']);

echo $item->getValue(); // d033e22ae348aeb5660fc2140aec35850c4da997