wriver4/activerecord 问题修复 & 功能扩展

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

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

wriver4/activerecord

Composer 安装命令:

composer require wriver4/activerecord

包简介

Activerecord is a revised implementation of php-Activerecord by jpfuent an open source ORM library based on the Activerecord pattern.

README 文档

README

Warning working on conforming to PSR-1 starting 5/11/2016 use Ver. 1.1

Instructions

Uses Composer to manage autoload. In bootstrap file assuming root directory.

$loader = require_once 'vendor/autoload.php';
$loader->addPsr4('Models\\', __dir__.'\Models');
// What? Why? Composers base path is vendor and I don't want to update Composer for every new Model.

//Simple Config
$cfg = Activerecord\Config::instance();
$cfg->setConnections(array(
    'development' =>
    'mysql://root:root@localhost/treebark?charset=utf8'));

Model classes

namespace Models;

class Bar \\ for table name bars by convention
        extends \Activerecord\Model \\ leading slash required
{
}

Super Simple Usage Example:

$bars = Models\Bar::find(1)->to_array();
echo $bars['name'];
echo '<br>';
$bars = Models\Bar::all();
foreach ($bars as $bar)
{
    echo '<br> id:';
    echo $bar->id;
    echo '<br> Name of Bar:';
    echo $bar->name;
    echo '<br> Address:';
    echo $bar->address;
    echo '<br>';
}

The php-Activerecord.org instructions for use remain the same.

Updated 4/25/2016

A revised implementation of php-Activerecord by jpfuentes; Currently working but testing system incomplete.

Original Commit 12/9/2015

A revised implementation of php-Activerecord by jpfuentes This is an inprocess version testing is not complete. So far the php-Activerecord.org instructions for use remain the same.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-04-27

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固