46 lines
923 B
PHP
Executable File
46 lines
923 B
PHP
Executable File
<?php
|
|
/**
|
|
* Copyright © All rights reserved.
|
|
* See COPYING.txt for license details.
|
|
*/
|
|
declare(strict_types=1);
|
|
|
|
namespace JR\NetSuite\Block\Adminhtml\Location\Edit;
|
|
|
|
use Magento\Backend\Block\Widget\Context;
|
|
|
|
abstract class GenericButton
|
|
{
|
|
|
|
protected $context;
|
|
|
|
/**
|
|
* @param \Magento\Backend\Block\Widget\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);
|
|
}
|
|
} |