bmt/isrc

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

dev-main 2023-05-15 08:38 UTC

This package is auto-updated.

Last update: 2024-09-15 11:26:51 UTC


README

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

安装

您可以通过Composer来包含ISRC类到您的项目中。

composer require bmt/isrc

用法

通过提供必要的参数(国家代码、注册者代码、年份和指定代码)来实例化ISRC类。然后,您可以使用各种方法与ISRC对象交互。

创建ISRC对象

use Bmt\ISRC\ISRC;

$isrc = new ISRC("US", "ABC", "21", "12345");

检索ISRC组件

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

$countryCode = $isrc->getCountryCode(); // Returns the country code (e.g., "US")
$registrantCode = $isrc->getRegistrantCode(); // Returns the registrant code (e.g., "ABC")
$year = $isrc->getYear(); // Returns the year (e.g., "21")
$designationCode = $isrc->getDesignationCode(); // Returns the designation code (e.g., "12345")

生成完整的ISRC代码

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

$newIsrcCode = $isrc->generateISRC(); // Returns a new ISRC code (e.g., "USABC2112345")

转换为字符串

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

$isrcString = (string)$isrc; // Returns the ISRC code as a string (e.g., "USABC2112345")

许可证

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


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