38 lines
1002 B
PHP
38 lines
1002 B
PHP
<?php
|
|
|
|
|
|
namespace app\controllers;
|
|
|
|
|
|
use app\services\api\SyncCategory;
|
|
use app\services\api\SyncObject;
|
|
use yii\web\Controller;
|
|
|
|
class ApiSyncController extends Controller
|
|
{
|
|
public function beforeAction($action)
|
|
{
|
|
date_default_timezone_set('Europe/Sofia');
|
|
return parent::beforeAction($action); // TODO: Change the autogenerated stub
|
|
}
|
|
|
|
public function actionMainCategory($actionType) {
|
|
return $this->asJson((new SyncCategory())->container("main_$actionType"));
|
|
}
|
|
public function actionSubCategory($actionType) {
|
|
return $this->asJson((new SyncCategory())->container("sub_$actionType"));
|
|
}
|
|
|
|
public function actionObjectTemplate($actionType) {
|
|
return $this->asJson(['type' => $actionType]);
|
|
}
|
|
|
|
public function actionSetObject() {
|
|
return $this->asJson((new SyncObject())->container('setObject'));
|
|
}
|
|
|
|
public function actionUnsetObject() {
|
|
return $this->asJson((new SyncObject())->container('unsetObject'));
|
|
}
|
|
}
|