PHP code example of javaabu / pgodb-sdk

1. Go to this page and download the library: Download javaabu/pgodb-sdk library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

javaabu / pgodb-sdk example snippets


$apiKey = "iK4YfZe2i1RAe22tKP4xejGKDZP ....";
$baseUri = "http://pgodb.test/api/v1/"
$pgoDb = new PgoDB($apiKey, $baseUri);

$pgoDb->criminalCase()->get();

$pgoDb->criminalCase()->find($idString);

$pgoDb->criminalCase()->addFilter("search", $idString)->get();

// 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);

// 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": "[email protected]"
    ]
];

$pgoDb->criminalCase()
      ->whereId("7/2022")
      ->complainant()
      ->store($data);

// Sample data  
$data = [
    "institution_reg_no": "javaabu",
];

$pgoDb->criminalCase()
      ->whereId("2123756022")
      ->update($data);

// Sample data  
$data = [
    "individual": [
        "permanent_address_country_code": "MV",
    ]
];

$pgoDb->criminalCase()
      ->whereId("7/2022")
      ->complainant()
      ->whereId("A169993")
      ->update($data);

$pgoDb->criminalCase()
      ->addSort("created_at")
      ->addSortByDesc("updated_at")
      ->get()