fenix440/model-type

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

1.2.0 2015-06-21 18:52 UTC

This package is auto-updated.

Last update: 2024-09-19 09:00:13 UTC


README

某种模型类型的获取器和设置器包。

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

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

内容

[目录]

何时使用此包

当您的组件(s)需要了解某种类型时

如何安装

#!console

composer require fenix440/model-type versionNumber

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

快速入门

假设您有一个接口,例如产品接口,您可以扩展类型感知接口;

#!php
<?php
use Fenix440\Model\Type\General\Interfaces\TypeAware;

interface IProduct extends TypeAware{

    // ... Remaining interface implementation not shown

}

在您的类实现中,您只需使用其中一个名称特性。

#!php
<?php
use Fenix440\Model\Type\General\Traits\TypeTrait;

class MyProduct implements IProduct {
   
     use TypeTrait;
   
     // ... Remaining implementation not shown...

}

许可证

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