sirolad/potato-orm 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

sirolad/potato-orm

Composer 安装命令:

composer require sirolad/potato-orm

包简介

A basic CRUD Object Relational Mapper

README 文档

README

License Build Status Quality Score

This package performs basic CRUD operation using Object Relational Mapping(ORM) :

DIRECTORY STRUCTURE

src/           core package code
   |DB         database connection class
   |Entities   samples class to test the model class
   |Exceptions custom exception classes
   |Libraries  helper classes
tests/         tests of the core package

Installation

PHP 5.3+ and Composer are required.

Via Composer

$ composer require sirolad/potato-orm

or

"require": {
        "sirolad/potato-orm": "dev-master"
    }

Usage

Extend Potato class like so

    class Goat extends Potato
    {
    }

The following method can be used to access the classes

getAll

   $goat = Goat::getAll();
   print_r($goat);

This should print out all the ​goats ​in the ​goats ​table of Goat class.

find

    $goat = Goat::find(1);
    $goat->password = "ewure";
    echo $goat->save();

This should find the ​goat ​with id=1 in the goats table and change the password to ewure.

save

    $goat = new Goat();
    $goat->name = "billy";
    $goat->age  = 25;
    $goat->job  = "developer";
    $goat->save();

This should insert a record for goat billy in the goats table.

Update

    $goat = Goat::where('name', 'JackBauer');
    $goat->password = "wetina";
    $goat->save();

Change log

Please check out CHANGELOG file for information on what has changed recently.

Testing

$ vendor/bin/phpunit test
$ composer test

Contributing

Please check out CONTRIBUTING file for detailed contribution guidelines.

Credits

PotatoORM is developed and maintained by Surajudeen Akande.

License

PotatoORM is released under the MIT Licence. See the bundled LICENSE file for details.

Supported Databases

MySQL
PGSQL

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-10-25