2016-01-03 05:48:37 +05:30
|
|
|
<?php
|
|
|
|
namespace api\controllers;
|
|
|
|
|
2016-01-15 14:51:27 +05:30
|
|
|
use api\traits\ApiNormalize;
|
2016-02-14 23:20:10 +05:30
|
|
|
use Yii;
|
2016-01-03 05:48:37 +05:30
|
|
|
|
2016-02-14 23:20:10 +05:30
|
|
|
/**
|
|
|
|
* @property \common\models\Account|null $account
|
|
|
|
*/
|
2016-01-03 05:48:37 +05:30
|
|
|
class Controller extends \yii\rest\Controller {
|
2016-01-15 14:51:27 +05:30
|
|
|
use ApiNormalize;
|
2016-01-03 05:48:37 +05:30
|
|
|
|
|
|
|
public function behaviors() {
|
|
|
|
$parentBehaviors = parent::behaviors();
|
|
|
|
// xml нам не понадобится
|
|
|
|
unset($parentBehaviors['contentNegotiator']['formats']['application/xml']);
|
|
|
|
|
|
|
|
return $parentBehaviors;
|
|
|
|
}
|
|
|
|
|
2016-02-14 23:20:10 +05:30
|
|
|
/**
|
|
|
|
* @return \common\models\Account|null
|
|
|
|
*/
|
|
|
|
public function getAccount() {
|
|
|
|
return Yii::$app->getUser()->getIdentity();
|
|
|
|
}
|
|
|
|
|
2016-01-03 05:48:37 +05:30
|
|
|
}
|