-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Igor Nikolaev
committed
Jan 28, 2021
1 parent
341a193
commit 085f19e
Showing
5 changed files
with
75 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,3 +15,5 @@ | |
- Add Request::getCommand(); | ||
|
||
- Add Command::getParam(); | ||
|
||
6.2.4: Add lead router. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
parameters: | ||
darvin_bitrix24.router.lead.class: Darvin\Bitrix24Bundle\Router\LeadRouter | ||
|
||
services: | ||
Darvin\Bitrix24Bundle\Router\LeadRouterInterface: '@darvin_bitrix24.router.lead' | ||
|
||
darvin_bitrix24.router.lead: | ||
class: '%darvin_bitrix24.router.lead.class%' | ||
arguments: | ||
- '%darvin_bitrix24.account.domain%' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?php declare(strict_types=1); | ||
/** | ||
* @author Igor Nikolaev <[email protected]> | ||
* @copyright Copyright (c) 2021, Darvin Studio | ||
* @link https://www.darvin-studio.ru | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Darvin\Bitrix24Bundle\Router; | ||
|
||
/** | ||
* Lead router | ||
*/ | ||
class LeadRouter implements LeadRouterInterface | ||
{ | ||
/** | ||
* @var string | ||
*/ | ||
private $domain; | ||
|
||
/** | ||
* @param string $domain Domain | ||
*/ | ||
public function __construct(string $domain) | ||
{ | ||
$this->domain = $domain; | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
public function generateShowUrl(string $id): string | ||
{ | ||
return sprintf('https://%s/crm/lead/show/%s/', $this->domain, $id); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php declare(strict_types=1); | ||
/** | ||
* @author Igor Nikolaev <[email protected]> | ||
* @copyright Copyright (c) 2021, Darvin Studio | ||
* @link https://www.darvin-studio.ru | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Darvin\Bitrix24Bundle\Router; | ||
|
||
/** | ||
* Lead router | ||
*/ | ||
interface LeadRouterInterface | ||
{ | ||
/** | ||
* @param string $id Lead ID | ||
* | ||
* @return string | ||
*/ | ||
public function generateShowUrl(string $id): string; | ||
} |