javaabu/pgodb-sdk
Composer 安装命令:
composer require javaabu/pgodb-sdk
包简介
The Criminal Justice Sector SDK is a wrapper package that allows developers to integrate their existing data infrastructure with the data-sharing platform developed by the Prosecutor General's Office.
README 文档
README
General PHP SDK to interact with the API of the Prosecutor General's Office's criminal justice sector database.
Installation
Use Composer to install the package
composer require javaabu/pgodb-sdk
Pre-Requisites
- PHP 7.4
Basic Usage
Initialisation
The API key is taken as a single, mandatory parameter.
$apiKey = "iK4YfZe2i1RAe22tKP4xejGKDZP ...."; $baseUri = "http://pgodb.test/api/v1/" $pgoDb = new PgoDB($apiKey, $baseUri);
Note
- Check the SOP to understand how to get an API token (you may use either a personal access token or a password token). Use this as the
API_TOKEN. - Use the
hostparameter, defined in the API documentation, as theBASE_URI.
Retrieve all Models
$pgoDb->criminalCase()->get();
Retrieve by Id
We do not use database ids, but rather administrative identification strings such as an individual's national identity card number, passport number, registration number (for judges and lawyers), incident reference numbers, gaziyyah numbers and the like.
$pgoDb->criminalCase()->find($idString);
This is a wrapper for the filter functionality built into this package.
An alternate way of doing this is as follows:
$pgoDb->criminalCase()->addFilter("search", $idString)->get();
The search term would change depending on the model being retrieved. The find function
abstracts this complexity away for the user.
Store Non-Nested Model
// Sample data $data = [ "incident_reference_number": "2123756022", "institution_reg_no": "pgo", "incident_at": "1996-12-30T09:11:26.000000Z", "lodged_at": "1998-03-13T19:00:00.000000Z" ]; $pgoDb->criminalCase()->store($data);
Store Nested Model
// Sample data $data = [ "individual": [ "nid": "A169993", "name": "Dr. Larissa Stokes", "name_en": "Mr. Benedict Lockman I", "gender": "female", "mobile_number": "860.660.2765", "nationality_code": "MV", "permanent_address_country_code": "MV", "permanent_address_city_code": "LD0894", "permanent_address": "67353 Rebeka Road\nEast Opal, PA 94709", "individual_type": "local", "dob": "1995-07-14T19:00:00.000000Z", "email": "pemmerich@example.net" ] ]; $pgoDb->criminalCase() ->whereId("7/2022") ->complainant() ->store($data);
Update Non-Nested Model
// Sample data $data = [ "institution_reg_no": "javaabu", ]; $pgoDb->criminalCase() ->whereId("2123756022") ->update($data);
Update Nested Model
// Sample data $data = [ "individual": [ "permanent_address_country_code": "MV", ] ]; $pgoDb->criminalCase() ->whereId("7/2022") ->complainant() ->whereId("A169993") ->update($data);
Sorting
$pgoDb->criminalCase() ->addSort("created_at") ->addSortByDesc("updated_at") ->get()
Ending Functions
The ending functions of each of these chained functions are defined as follows. The actual API request will be sent once these ending functions are called at the end of the chain.
get()Should return a list of items,find($id)Should return a single item,delete($id)Sends a delete request and returns true or false,store($data)Returns the newly stored record,update($data)Returns the updated record.
Changelog
Please see CHANGELOG for more information on what has changed recently.
Security Vulnerabilities
If you discover any security related issues, please email info@javaabu.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.
javaabu/pgodb-sdk 适用场景与选型建议
javaabu/pgodb-sdk 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 26 次下载、GitHub Stars 达 0, 最近一次更新时间为 2023 年 03 月 08 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「Javaabu Pvt Ltd」 「pgodb-sdk」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 javaabu/pgodb-sdk 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 javaabu/pgodb-sdk 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 javaabu/pgodb-sdk 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Simplifies stats generation for Laravel
Customized version of Laravel for Javaabu
Laravel wrapper for BML Connect PHP SDK
Adds Geospatial attribute support to Laravel projects
Adds multi-lingual to Laravel models
Bandeyri pay gateway integration for Laravel
统计信息
- 总下载量: 26
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 19
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-03-08