PHP code example of digtyarenko / osnova-php-sdk

1. Go to this page and download the library: Download digtyarenko/osnova-php-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/ */

    

digtyarenko / osnova-php-sdk example snippets




use Osnova\Api\DtfApi;
use Osnova\Api\Service\Timeline\Enum\CategoryEnum;
use Osnova\Api\Service\Timeline\Enum\SortingEnum;
use Osnova\Api\Service\Timeline\TimelineService;

$api = DtfApi::init();
$timelineService = $api->getService(TimelineService::class);

$result = $timelineService->getTimeline(
    new CategoryEnum(CategoryEnum::INDEX),
    new SortingEnum(SortingEnum::RECENT)
)->getResult();



use Osnova\Api\DtfApi;
use Osnova\Api\Service\Subsite\Enum\TypeEnum;
use Osnova\Api\Service\Subsite\SubsiteService;

$api = DtfApi::init();
$subsiteService = $api->getService(SubsiteService::class);

$result = $subsiteService->getSubsitesList(new TypeEnum(TypeEnum::SECTIONS))->getResult();



use Osnova\Api\DtfApi;
use Osnova\Api\Service\Subsite\Enum\SortingEnum;
use Osnova\Api\Service\Subsite\SubsiteService;

$api = DtfApi::init();
$subsiteService = $api->getService(SubsiteService::class);

$result = $subsiteService->getSubsiteTimeline(
    64953,
    new SortingEnum(SortingEnum::TOP_WEEK)
)->getResult();
 bash
$ composer