承接 jinnguyen/puja-entity 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

jinnguyen/puja-entity

Composer 安装命令:

composer require jinnguyen/puja-entity

包简介

Puja-Entity is an abstract layer to manage a entity object and easy to get the Docblock document

关键字:

README 文档

README

Puja-Entity is an abstract layer to manage a entity object and easy to get the Docblock document

Install

composer required jinnguyen/puja-entity

Usage

include '/path/to/vendor/autoload.php';
use Puja\Entity\Entity;

Examples

/**
 * This comment is copied from ContentEntity->getDocblock(); you should do it each time you change the ContentEntity->attributes
 * @method int getId()
 * @method setId(int $attr)
 * @method hasId()
 * @method unsetId()
 * @method string getName()
 * @method setName(string $attr)
 * @method hasName()
 * @method unsetName()
 * @method string getCreatedAt()
 * @method setCreatedAt(string $attr)
 * @method hasCreatedAt()
 * @method unsetCreatedAt()
 * @method string getCreatedAt()
 * @method setCreatedAt(string $attr)
 * @method hasCreatedAt()
 * @method unsetCreatedAt()
 * @method Category getCategory()
 * @method setCategory(Category $attr)
 * @method hasCategory()
 * @method unsetCategory()
 */
class ContentEntity extends Entity
{
    protected $attributes = array(
        'id' => Entity::DATATYPE_INT,
        'name' => Entity::DATATYPE_STRING,
        'created_at' => Entity::DATATYPE_STRING,
        'price' => Entity::DATATYPE_INT,
        'category' => 'Category',
    );
    protected $defaults = array(
        'price' => 5,
    );
}

class Category
{
    public $id = 1;
    public $name = 'Category 1';
}

$content = new ContentEntity(array(
    'id' => 1,
    'name' => 'Content 1',
    'created_at' => '2016-11-18 00:00:00',
    'category' => new Category()
));

echo $content->getId(); // 1
echo $content->getName(); // Content 1
echo $content->getCreatedAt(); // 2016-11-18 00:00:00
echo $content->getId(); // 5

$category = $content->getCategory();
echo $category->name; // Category 1
echo $content->getDocblock(); // The dockbock content is used above class ContentEntity

Note: ContentEntity is Entity, but Category is not.

统计信息

  • 总下载量: 105
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 4
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Apache
  • 更新时间: 2016-11-18

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固