承接 basemotive/phersist 相关项目开发

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

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

basemotive/phersist

最新稳定版本:v0.4.12

Composer 安装命令:

composer require basemotive/phersist

包简介

A tiny PHP-ORM

关键字:

README 文档

README

PHersist is a lightweight ORM (Object-Relational Mapper) for PHP.

This allows you to generate PHP model classes that are backed by database tables. You can create objects and work with them like normal, and them commit the changes to the database when you're done modifying them. PHersist handles the SQL for you.

Small but powerful

PHersist is designed to be minimalistic in the sense that its codebase is kept small, and it doesn't use any external libraries. It manages that while still offering robust mapping for objects, relations and maps.

Use an existing database schema, or create one

You can make it work with most existing database schemas, as long as your tables are normalized. If you don't have an existing schema yet, you can generate one alongside your model classes.

Working with your model is easy

Creating new objects goes like this:

$user = new User();
$user->email = 'joe@example.org';
$user->password = password_hash('secret', PASSWORD_DEFAULT);
$user->name = 'Joe Example';
$user->commit();

echo "User created: {$user->name}\n";

And your new User is added to the database. Now if you need find that user later, it goes like this:

use PHersist\ObjectFinder;

$user = ObjectFinder::create(User::class)
	->where('email', '=', 'joe@example.org')
	->fetchOne();

echo "User retrieved: {$user->name}\n";

And you've retrieved the User you had previously created.

Getting started

Read the documentation.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: LGPL-2.1-or-later
  • 更新时间: 2026-03-17

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固