定制 corelib/core 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

corelib/core

最新稳定版本:v0.5.0

Composer 安装命令:

composer require corelib/core

包简介

Corelib is mainly a Object Relational Mapper (ORM) for PHP. It focuses on flexibility and ease of use.

README 文档

README

Corelib is mainly a Object Relational Mapper (ORM) for PHP. It focuses on flexibility and ease of use.

Example

<?php
// get Data Access Object (DAO) which allows to read isntances from storage
$userDAO = \Corelib\User\UserFactory::getUserDAO();

//get Data Storage OBject (DSO) which allwos us to store isntances into storage
$userDSO = \Corelib\User\UserFactory::getUserDSO();

$userCollection = $userDAO->search("email LIKE '%@gmail.com' AND emailConfirmed = {$userDAO->boolean(true)}");

foreach ($userCollection as $userBO) {
    echo "Locking user {$userBO->getName()} <{$userBO->getEmail()}>";
    
    $userBO->setLocked(true);
    
    try {
        $userDSO->save($userBO);
    } catch (Exception $e)  {
        echo "Problem saving user {$userBO->getName()";
    }
}

Installing

Using Composer

# in your project directory run
$composer require "corelib/core ~0.5.0"

Structures

Corelib has several structures it uses here are the main ones.

  • Models

    Objects that hold data they represent a single instance.

  • Collections

    Objects that hold several Models of a given type.

  • Data Access Objects

    Objects used to read and retrieve objects using an SQL like syntax.

  • Data Store Objects

    Objects used to persist Models to a data store.

  • Relationships

    Objects that define how Models are related to each other.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-12-08