Server IP : 80.87.202.40 / Your IP : 216.73.216.169 Web Server : Apache System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64 User : bitrix ( 600) PHP Version : 8.2.27 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/bitrix/ext_www/cvetdv.ru/bitrix/modules/yandex.market/lib/api/reference/ |
Upload File : |
<?php namespace Yandex\Market\Api\Reference; use Yandex\Market\Psr; use Yandex\Market\Reference\Assert; use Yandex\Market\Reference\Concerns; use Yandex\Market\Trading; class AuthRepository { use Concerns\HasOnceStatic; /** @return array{Auth, Psr\Log\LoggerInterface} */ public static function any() { return self::onceStatic('any', static function() { $business = Trading\Business\Table::getRow([ 'filter' => [ [ 'LOGIC' => 'OR', [ 'SETTINGS.NAME' => 'API_KEY', '!SETTINGS.VALUE' => false ], [ 'SETTINGS.NAME' => 'OAUTH_TOKEN', '!SETTINGS.VALUE' => false ], ], ], 'select' => [ 'ID' ], ]); Assert::notNull($business, 'business'); return self::byBusiness($business['ID']); }); } /** * @param int $id * @return array{Auth, Psr\Log\LoggerInterface} */ public static function byBusiness($id) { return self::onceStatic('byBusiness', [ $id ], static function($id) { $business = Trading\Business\Model::loadById($id); return [ $business->getOptions()->getApiAuth(), $business->createLogger(), ]; }); } }