1. Go to this page and download the library: Download juanparati/podium 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/ */
juanparati / podium example snippets
$client = new \Juanparati\Podium\Podium(
session: '12346',
clientId: 'myClientId',
clientSecret: 'myClientSecret'
);
$client->authenticate(
new \Juanparati\Podium\Auths\AppAuth(
appId: '987654',
appToken: 'myAppToken'
)
);
$item = (new \Juanparati\Podium\Requests\ItemRequest($client))->get(itemId: 11111111);
$models = (new \Juanparati\Podium\Requests\ItemRequest($client))->filter(appId: 987654);
$models = (new \Juanparati\Podium\Models\ItemFilterModel([], $client))
->setSortBy('last_edit_on')
->setSortDesc(true)
->setLimit(5);
$itemNum = 0;
foreach ($models->items() as $item) {
print_r($item->originalValues())
// The setLimit options indicate the limit of items per page to the request,
// but the generator will automatically request the next page.
// In order to limit the number of results we should manually limit the results.
if ($itemNum === 10)
break;
$itemNum++;
}
$item->originalValues();
$item->decodeValue();
// Accessing to the fields
$item->fields->decodeValue();
// Accessing to specific values
$item->fields->title;
$item->fields->{'my-custom-field'};
// Accessing to specific values
$item->fields->title = "My new title";
$item->save(silent: false, hook: true); // Will perform silent update calling the bounded hooks