fenix440/model-duration

模型持续时间获取器和设置器包。此包是项目 'Aedart\Model' 的一部分,访问 https://bitbucket.org/aedart/model 了解更多信息。官方子包网站(https://bitbucket.org/fenix440/model-duration/)。

1.0.0 2015-04-25 14:10 UTC

This package is auto-updated.

Last update: 2024-09-19 09:42:51 UTC


README

某些类型模型持续时间的获取器和设置器包。

此包是项目 Aedart\Model 的一部分,访问 https://bitbucket.org/aedart/model 了解更多信息。

官方子包网站(https://bitbucket.org/fenix440/model-duration

内容

[目录]

何时使用此包

当你的组件需要了解持续时间属性时

如何安装

#!console

composer require fenix440/model-duration  versionNumber

此包使用 composer。如果你不知道这是什么或如何工作,建议在尝试使用此包之前先了解一下。

快速开始

假设你有一个接口,例如一个作业的接口,你可以扩展持续时间感知接口;

#!php
<?php
use Fenix440\Model\Duration\Interfaces\DurationAware;

interface IJob extends DurationAware{

    // ... Remaining interface implementation not shown

}

在你的类实现中,你可以简单地使用其中一个持续时间特质。

#!php
<?php
use Fenix440\Model\Duration\Traits\DurationTrait;

class MyJob implements IJob {
   
     use DurationTrait;
   
     // ... Remaining implementation not shown...

}

许可证

BSD-3-Clause,阅读此包中包含的 LICENSE 文件