定制 toddheslin/pocketbase-php-sdk 二次开发

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

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

toddheslin/pocketbase-php-sdk

最新稳定版本:v2.0.2

Composer 安装命令:

composer require toddheslin/pocketbase-php-sdk

包简介

README 文档

README

PHP SDK for Pocketbase

This repository is a fork of Jonathan's work. I've extended it to deal with specific issues we needed to address for a Wordpress PHP plugin. I have also moved it back to Github because I do all of my work here.

// Example init and use
use \Pb\Client as pb;
$pb = new pb('https://backend-shop.mkay.dev');
var_dump($pb->collection('countries')->getList());

Crud adapted from js-sdk to php

// Returns a paginated records list.
$pb->collection(collectionIdOrName)->getList(int $page = 1, int $perPage = 30, array $queryParams = []);

// Returns a list with all records batch fetched at once.
$pb->collection(collectionIdOrName)->getFullList(int $batch = 200, array $queryParams = []);

// Returns the first found record matching the specified filter.
$pb->collection(collectionIdOrName)->getFirstListItem(string $filter, array $queryParams = []);

// Returns a single record by its id.
$pb->collection(collectionIdOrName)->getOne(string $recordId, array $queryParams = []);

// Creates (aka. register) a new record.
$pb->collection(collectionIdOrName)->create(array  $bodyParams = [], array $queryParams = []);

// Updates an existing record by its id.
$pb->collection(collectionIdOrName)->update(string $recordId, array $bodyParams = [],array $queryParams = []);

// Deletes a single record by its id.
$pb->collection(collectionIdOrName)->delete(string $recordId, array $queryParams = []);

// Custom Logic
$pb->collection(collectionIdOrName)->upload(string $recordId, string $field, string $filepath);

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-12-05