Initial import
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
<?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'));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user