programster/pgsql-objects 问题修复 & 功能扩展

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

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

programster/pgsql-objects

最新稳定版本:3.0.6

Composer 安装命令:

composer require programster/pgsql-objects

包简介

A library for interfacing with a PostgreSQL database in PHP. Facilitates the creation of objects that represents tables tables. Objects must have id of type UUID.

README 文档

README

This package aims to act as your object-relational-map (ORM) to a PostgreSQL database.

To use this package, we recommend you create two class files for each of your tables. One should end in the word Table and represent operations on the table itself. This should ideally extend the AbstractTable in the package. If you need to create something rather special, then one can just implement the TableInterface interface. Once you have extended the class, all you have to do is fill in all of the abstract methods.

The second class you need to create is for a row/object of the table. This class should extend the AbstractTableRowObject. Again, just fill in all of the abstract methods for the package to be able to manage your tables.

Limitations

This package only works with tables that have an id column of type uuid.

Key Features

  • Save/updates objects to the database for you when you want it to.
  • implement an automatica local cache, so you don't re-fetch objects when you don't need to. E.g. if you make a call to MyTable::loadAll() before then trying to load a bunch of objects by ID, then the objects will be returned immediately without having to hit the database because they were all loaded into the cache.
  • Supports cloning of the objects - will generate a new UUID for the clone and mark it as not being in the database. It will only be persisted if you save it to the database.

Testing

If you wish to create some changes and run the tests, simply fill in you PostgreSQL host details into the /testing/settings.php.tmpl file and rename it to /testing/settings.php.

Then run the tests with:

php testing/main.php

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-07-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固