承接 eden/model 相关项目开发

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

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

eden/model

Composer 安装命令:

composer require eden/model

包简介

Eden generic model component

README 文档

README

Build Status

====

Install

composer install eden/model

====

Introduction

Manipulating array data in most cases can be expressed as a model. Models in Eden is defined loosely and as a utility class to help managing data in a controlled and chainable format. The basic setup of a model is described in Figure 1.

Figure 1. Setup

$user = array(
	'user_name' => 'Chris',
	'user_email' => 'cblanquera@openovate.com',
	'user_location' => 'Manila, Philippines');

eden('model', $user);

From here we can access properties in our model as a method, property or back as an array. Figure 2 shows the ways to access data in action.

Figure 2. Accessing Model Properties

//set user name
$model->setUserName('Chris');            

// returns user email
$model->getUserEmail();                  

// set any abstract key
$model->setAnyThing('somthing');

// get any abstract key
$model->getAnyThing();              	
 
//access as array
echo $model['user_name'];

//set as array
$model['user_email'] = 'my@email.com';

//access as object
echo $model->user_name;  

//set as object
$model->user_name = 'my@email.com';    

We added several common methods to futher manipulate model data.

Figure 3. Utility Methods

//for each row, copy the value of post_user to the user_id column
$model->copy('post_user', 'user_id');

//returns a raw array (no object)
$model->get();  

====

#Contributing to Eden

Contributions to Eden are following the Github work flow. Please read up before contributing.

##Setting up your machine with the Eden repository and your fork

  1. Fork the repository
  2. Fire up your local terminal create a new branch from the v4 branch of your fork with a branch name describing what your changes are. Possible branch name types:
    • bugfix
    • feature
    • improvement
  3. Make your changes. Always make sure to sign-off (-s) on all commits made (git commit -s -m "Commit message")

##Making pull requests

  1. Please ensure to run phpunit before making a pull request.
  2. Push your code to your remote forked version.
  3. Go back to your forked version on GitHub and submit a pull request.
  4. An Eden developer will review your code and merge it in when it has been classified as suitable.

统计信息

  • 总下载量: 15.08k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 6
  • 推荐数: 0

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2013-09-24

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固