bmt/iswc

类 ISWC 表示国际标准音乐作品代码(ISWC),并提供操作该代码的方法。

dev-main 2023-05-15 09:37 UTC

This package is auto-updated.

Last update: 2024-09-15 12:54:47 UTC


README

ISWC 类是一个 PHP 类,表示国际标准音乐作品代码(ISWC)。它提供了解析、检索组件和生成新代码的方法来操作 ISWC 代码。

安装

您可以通过 Composer 包管理器将 ISWC 类包含到您的项目中。

composer require bmt/iswc

使用方法

通过提供必要的参数(国家代码、出版社代码和工作代码)来实例化 ISWC 类。然后,您可以使用各种方法与 ISWC 对象交互。

创建 ISWC 对象

use Bmt\ISRC\ISWC;

$iswc = new ISWC("123", "456", "01");

解析 ISWC 代码

您可以通过解析现有的 ISWC 代码来设置 ISWC 对象的相应组件。

$iswc->parse("T-123456789-01");

检索 ISWC 组件

您可以检索 ISWC 代码的各个组件。

$countryCode = $iswc->getCountryCode(); // Returns the country code (e.g., "123")
$publisherCode = $iswc->getPublisherCode(); // Returns the publisher code (e.g., "456")
$workCode = $iswc->getWorkCode(); // Returns the work code (e.g., "01")

生成完整的 ISWC 代码

根据存储的组件生成完整的 ISWC 代码。

$newIswcCode = $iswc->generateISWC(); // Returns a new ISWC code (e.g., "T-123456789-01")

转换为字符串

您还可以将 ISWC 对象转换为字符串,这将返回生成的 ISWC 代码。

$iswcString = (string)$iswc; // Returns the ISWC code as a string (e.g., "T-123456789-01")

许可证

本项目采用 MIT 许可证。有关详细信息,请参阅 LICENSE 文件。


Feel free to modify and customize the README file to fit your specific project needs.