mirror of
https://github.com/elyby/accounts.git
synced 2024-12-02 11:41:05 +05:30
36 lines
718 B
PHP
36 lines
718 B
PHP
<?php
|
|
namespace console\controllers\base;
|
|
|
|
use Ely\Amqp\ControllerTrait;
|
|
use Yii;
|
|
use yii\console\Controller;
|
|
use yii\helpers\ArrayHelper;
|
|
use yii\helpers\Inflector;
|
|
|
|
abstract class AmqpController extends Controller {
|
|
use ControllerTrait;
|
|
|
|
public final function actionIndex() {
|
|
$this->start();
|
|
}
|
|
|
|
public function getRoutesMap() {
|
|
return [];
|
|
}
|
|
|
|
/**
|
|
* @inheritdoc
|
|
*/
|
|
protected function getConnection() {
|
|
return Yii::$app->amqp->getConnection();
|
|
}
|
|
|
|
/**
|
|
* @inheritdoc
|
|
*/
|
|
protected function buildRouteActionName($route) {
|
|
return ArrayHelper::getValue($this->getRoutesMap(), $route, 'route' . Inflector::camelize($route));
|
|
}
|
|
|
|
}
|