PHPackages                             jackie-source/ash-entity - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. jackie-source/ash-entity

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

jackie-source/ash-entity
========================

Public Class Function Method Package

v1.0.1(2y ago)05Apache-2.0PHPPHP &gt;=7.4

Since Oct 19Pushed 2y ago1 watchersCompare

[ Source](https://github.com/jackie-source/ash-entity)[ Packagist](https://packagist.org/packages/jackie-source/ash-entity)[ RSS](/packages/jackie-source-ash-entity/feed)WikiDiscussions main Synced yesterday

READMEChangelogDependencies (1)Versions (2)Used By (0)

常用的一些扩展类库
=========

[](#常用的一些扩展类库)

> 以下类库都在`\\Ash\\Helper`命名空间下

Str
---

[](#str)

> 字符串操作

```
// 检查字符串中是否包含某些字符串
Str::contains($haystack, $needles)

// 检查字符串是否以某些字符串结尾
Str::endsWith($haystack, $needles)

// 获取指定长度的随机字母数字组合的字符串
Str::random($length = 16)

// 字符串转小写
Str::lower($value)

// 字符串转大写
Str::upper($value)

// 获取字符串的长度
Str::length($value)

// 截取字符串
Str::substr($string, $start, $length = null)

```

Arr
---

[](#arr)

> 数组操作

```

// 确定给定值是否为数组可访问的。
Arr::accessible($value)

// 在数组中添加一个不存在的元素
Arr::add($array, $key, $value)

// 将数组的数组折叠成单个数组
Arr::collapse($array)

// 将一个数组划分为两个数组。一个带有键，另一个带有值
Arr::divide($array)

// 返回数组中第一个通过给定真值检验的元素
Arr::first($array, callable $callback = null, $default = null)

// 从给定数组中删除一个或多个数组项
Arr::forget(&$array, $keys)

// 检查数组中是否存在一个或多个项
Arr::has($array, $keys)

```

CurrencyAmount
--------------

[](#currencyamount)

> 币种金额操作

```

$objCurrencyAmount = new CurrencyAmount();

/**
 * 获取对象属性方法
 *
 * 返回对象数据结构，例如:
 * Ash\Format\Currency Object
 *  (
 *   [currency:protected] => GBP
 *   [amount:protected] => 100
 *   [currency_id:protected] => 1
 * )
 */
$obj = $objCurrencyAmount->get(float $amount, int $currencyId = 0, string $currency = ''): Currency

// 获取属性币种ID
$obj->getCurrencyId(); // 1

// 获取属性币种
$obj->getCurrency(); // GBP

// 获取属性金额
$obj->getAmount(); // 100

// 对象转数组
$obj->toArray(); // Array([currency] => GBP [amount] => 100 [currency_id] => 1)

// 对象转Json
$obj->toJson(); // {"currency":"GBP","amount":100,"currency_id":1}

```

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

989d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e85576b9f593b02c7b7470035203495e07c9f44ece2fb233f43733d9e7abdec0?d=identicon)[shuixuqiang](/maintainers/shuixuqiang)

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/jackie-source-ash-entity/health.svg)

```
[![Health](https://phpackages.com/badges/jackie-source-ash-entity/health.svg)](https://phpackages.com/packages/jackie-source-ash-entity)
```

###  Alternatives

[symfony/filesystem

Provides basic utilities for the filesystem

4.6k710.3M4.0k](/packages/symfony-filesystem)[fof/mason

Add custom fields to discussions

206.5k](/packages/fof-mason)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
