49 lines
1003 B
PHP
Executable File
49 lines
1003 B
PHP
Executable File
<?php
|
|
/**
|
|
* @author Olegnax
|
|
* @package Olegnax_GoogleMap
|
|
* @copyright Copyright (c) 2020 Olegnax (http://olegnax.com/). All rights reserved.
|
|
* See COPYING.txt for license details.
|
|
*/
|
|
declare(strict_types=1);
|
|
|
|
namespace Olegnax\GoogleMap\Block\Adminhtml\Location\Edit;
|
|
|
|
use Magento\Backend\Block\Widget\Context;
|
|
|
|
abstract class GenericButton
|
|
{
|
|
|
|
protected $context;
|
|
|
|
/**
|
|
* @param Context $context
|
|
*/
|
|
public function __construct(Context $context)
|
|
{
|
|
$this->context = $context;
|
|
}
|
|
|
|
/**
|
|
* Return model ID
|
|
*
|
|
* @return int|null
|
|
*/
|
|
public function getModelId()
|
|
{
|
|
return $this->context->getRequest()->getParam('location_id');
|
|
}
|
|
|
|
/**
|
|
* Generate url by route and parameters
|
|
*
|
|
* @param string $route
|
|
* @param array $params
|
|
* @return string
|
|
*/
|
|
public function getUrl($route = '', $params = [])
|
|
{
|
|
return $this->context->getUrlBuilder()->getUrl($route, $params);
|
|
}
|
|
}
|