mirror of
https://github.com/bdnugget/magento2.git
synced 2026-11-07 17:27:36 +00:00
41 lines
711 B
PHP
41 lines
711 B
PHP
<?php
|
|
/**
|
|
* Copyright © Magento, Inc. All rights reserved.
|
|
* See COPYING.txt for license details.
|
|
*/
|
|
declare(strict_types=1);
|
|
|
|
namespace Magento\Customer\Model;
|
|
|
|
use Magento\Framework\App\RequestInterface;
|
|
|
|
/**
|
|
* Provides customer id from request.
|
|
*/
|
|
class CustomerIdProvider
|
|
{
|
|
/**
|
|
* @var RequestInterface
|
|
*/
|
|
private $request;
|
|
|
|
/**
|
|
* @param RequestInterface $request
|
|
*/
|
|
public function __construct(
|
|
RequestInterface $request
|
|
) {
|
|
$this->request = $request;
|
|
}
|
|
|
|
/**
|
|
* Get customer id from request.
|
|
*
|
|
* @return int
|
|
*/
|
|
public function getCustomerId(): int
|
|
{
|
|
return (int)$this->request->getParam('id');
|
|
}
|
|
}
|