BxAclModule.php 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564
  1. <?php defined('BX_DOL') or die('hack attempt');
  2. /**
  3. * Copyright (c) UNA, Inc - https://una.io
  4. * MIT License - https://opensource.org/licenses/MIT
  5. *
  6. * @defgroup PaidLevels Paid Levels
  7. * @ingroup UnaModules
  8. *
  9. * @{
  10. */
  11. bx_import('BxDolAcl');
  12. define('BX_ACL_LICENSE_TYPE_SINGLE', 'single'); //--- one-time payment license
  13. define('BX_ACL_LICENSE_TYPE_RECURRING', 'recurring'); //--- recurring payment license
  14. class BxAclModule extends BxDolModule
  15. {
  16. /**
  17. * Constructor
  18. */
  19. function __construct($aModule)
  20. {
  21. parent::__construct($aModule);
  22. $this->_oConfig->init($this->_oDb);
  23. }
  24. /**
  25. * ACTION METHODS
  26. */
  27. public function actionCheckName()
  28. {
  29. $CNF = &$this->_oConfig->CNF;
  30. $sName = bx_process_input(bx_get('name'));
  31. if(empty($sName))
  32. return echoJson(array());
  33. $sResult = '';
  34. $iId = (int)bx_get('id');
  35. if(!empty($iId)) {
  36. $aPrice = $this->_oDb->getPrices(array('type' => 'by_id', 'value' => $iId));
  37. if(strcmp($sName, $aPrice[$CNF['FIELD_NAME']]) == 0)
  38. $sResult = $sName;
  39. }
  40. echoJson(array(
  41. 'name' => !empty($sResult) ? $sResult : $this->_oConfig->getPriceName($sName)
  42. ));
  43. }
  44. /**
  45. * SERVICE METHODS
  46. */
  47. public function serviceGetSafeServices()
  48. {
  49. return array (
  50. 'GetViewUrl' => '',
  51. 'GetBlockView' => '',
  52. 'GetMembershipActions' => '',
  53. );
  54. }
  55. /**
  56. * @page service Service Calls
  57. * @section bx_acl Paid Levels
  58. * @subsection bx_acl-other Other
  59. * @subsubsection bx_acl-get_view_url get_view_url
  60. *
  61. * @code bx_srv('bx_acl', 'get_view_url', [...]); @endcode
  62. *
  63. * Get page URL with membership levels list.
  64. *
  65. * @return string with page URL.
  66. *
  67. * @see BxAclModule::serviceGetViewUrl
  68. */
  69. /**
  70. * @ref bx_acl-get_view_url "get_view_url"
  71. */
  72. public function serviceGetViewUrl()
  73. {
  74. $CNF = &$this->_oConfig->CNF;
  75. return BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink($CNF['URL_VIEW']);
  76. }
  77. /**
  78. * @page service Service Calls
  79. * @section bx_acl Paid Levels
  80. * @subsection bx_acl-page_blocks Page Blocks
  81. * @subsubsection bx_acl-get_block_view get_block_view
  82. *
  83. * @code bx_srv('bx_acl', 'get_block_view', [...]); @endcode
  84. *
  85. * Get page block with a list of available ACL levels to purchase or get for Free. List is represented as table.
  86. *
  87. * @return HTML string with a list of ACL levels to display on the site, all necessary CSS and JS files are automatically added to the HEAD section of the site HTML. On error empty string is returned.
  88. *
  89. * @see BxAclModule::serviceGetBlockView
  90. */
  91. /**
  92. * @ref bx_acl-get_block_view "get_block_view"
  93. */
  94. public function serviceGetBlockView()
  95. {
  96. bx_require_authentication(false, false, $this->serviceGetViewUrl());
  97. $sGrid = $this->_oConfig->getGridObject('view');
  98. $oGrid = BxDolGrid::getObjectInstance($sGrid);
  99. if(!$oGrid)
  100. return '';
  101. $this->_oTemplate->addCss(array('view.css'));
  102. return array(
  103. 'content' => $oGrid->getCode()
  104. );
  105. }
  106. /**
  107. * @page service Service Calls
  108. * @section bx_acl Paid Levels
  109. * @subsection bx_acl-page_blocks Page Blocks
  110. * @subsubsection bx_acl-get_membership_actions get_membership_actions
  111. *
  112. * @code bx_srv('bx_acl', 'get_membership_actions', [...]); @endcode
  113. *
  114. * Get page block with a list of current membership level's actions.
  115. *
  116. * @return HTML string with a list of actions to display on the site, all necessary CSS and JS files are automatically added to the HEAD section of the site HTML. On error empty string is returned.
  117. *
  118. * @see BxAclModule::serviceGetMembershipActions
  119. */
  120. /**
  121. * @ref bx_acl-get_membership_actions "get_membership_actions"
  122. */
  123. public function serviceGetMembershipActions($iProfileId)
  124. {
  125. if($iProfileId != $this->getUserId())
  126. return '';
  127. return $this->_oTemplate->displayMembershipActions($iProfileId);
  128. }
  129. /**
  130. * @page service Service Calls
  131. * @section bx_acl Paid Levels
  132. * @subsection bx_acl-payments Payments
  133. * @subsubsection bx_acl-get_payment_data get_payment_data
  134. *
  135. * @code bx_srv('bx_acl', 'get_payment_data', [...]); @endcode
  136. *
  137. * Get an array with module's description. Is needed for payments processing module.
  138. *
  139. * @return an array with module's description.
  140. *
  141. * @see BxAclModule::serviceGetPaymentData
  142. */
  143. /**
  144. * @ref bx_acl-get_payment_data "get_payment_data"
  145. */
  146. public function serviceGetPaymentData()
  147. {
  148. return $this->_aModule;
  149. }
  150. /**
  151. * @page service Service Calls
  152. * @section bx_acl Paid Levels
  153. * @subsection bx_acl-payments Payments
  154. * @subsubsection bx_acl-get_cart_item get_cart_item
  155. *
  156. * @code bx_srv('bx_acl', 'get_cart_item', [...]); @endcode
  157. *
  158. * Get an array with level's description. Is used in Shopping Cart in payments processing module.
  159. *
  160. * @param $mixedItemId level's ID or Unique Name.
  161. * @return an array with level's description. Empty array is returned if something is wrong.
  162. *
  163. * @see BxAclModule::serviceGetCartItem
  164. */
  165. /**
  166. * @ref bx_acl-get_cart_item "get_cart_item"
  167. */
  168. public function serviceGetCartItem($mixedItemId)
  169. {
  170. $CNF = &$this->_oConfig->CNF;
  171. if(!$mixedItemId)
  172. return array();
  173. if(is_numeric($mixedItemId))
  174. $aItem = $this->_oDb->getPrices(array('type' => 'by_id_full', 'value' => (int)$mixedItemId));
  175. else
  176. $aItem = $this->_oDb->getPrices(array('type' => 'by_name_full', 'value' => $mixedItemId));
  177. if(empty($aItem) || !is_array($aItem))
  178. return array();
  179. return array (
  180. 'id' => $aItem['id'],
  181. 'author_id' => $this->_oConfig->getOwner(),
  182. 'name' => $aItem['name'],
  183. 'title' => _t('_bx_acl_txt_cart_item_title', _t($aItem['level_name']), $aItem['period'], $aItem['period_unit']),
  184. 'description' => _t($aItem['level_description']),
  185. 'url' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink($CNF['URL_VIEW']),
  186. 'price_single' => $aItem['price'],
  187. 'price_recurring' => $aItem['price'],
  188. 'period_recurring' => $aItem['period'],
  189. 'period_unit_recurring' => $aItem['period_unit'],
  190. 'trial_recurring' => $aItem['trial']
  191. );
  192. }
  193. /**
  194. * @page service Service Calls
  195. * @section bx_acl Paid Levels
  196. * @subsection bx_acl-payments Payments
  197. * @subsubsection bx_acl-get_cart_items get_cart_items
  198. *
  199. * @code bx_srv('bx_acl', 'get_cart_items', [...]); @endcode
  200. *
  201. * Get an array with levels' descriptions by seller. Is used in Manual Order Processing in payments processing module.
  202. *
  203. * @param $iSellerId seller ID.
  204. * @return an array with levels' descriptions. Empty array is returned if something is wrong or seller doesn't have any paid level.
  205. *
  206. * @see BxAclModule::serviceGetCartItems
  207. */
  208. /**
  209. * @ref bx_acl-get_cart_items "get_cart_items"
  210. */
  211. public function serviceGetCartItems($iSellerId)
  212. {
  213. $CNF = &$this->_oConfig->CNF;
  214. $iSellerIdSetting = $this->_oConfig->getOwner();
  215. if(empty($iSellerId) || ($iSellerId != $iSellerIdSetting && !isAdmin()))
  216. return array();
  217. $aItems = $this->_oDb->getPrices(array('type' => 'all_full'));
  218. $sUrl = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink($CNF['URL_VIEW']);
  219. $aResult = array();
  220. foreach($aItems as $aItem)
  221. $aResult[] = array(
  222. 'id' => $aItem['id'],
  223. 'author_id' => $iSellerIdSetting,
  224. 'name' => $aItem['name'],
  225. 'title' => _t('_bx_acl_txt_cart_item_title', _t($aItem['level_name']), $aItem['period'], $aItem['period_unit']),
  226. 'description' => _t($aItem['level_description']),
  227. 'url' => $sUrl,
  228. 'price_single' => $aItem['price'],
  229. 'price_recurring' => $aItem['price'],
  230. 'period_recurring' => $aItem['period'],
  231. 'period_unit_recurring' => $aItem['period_unit'],
  232. 'trial_recurring' => $aItem['trial']
  233. );
  234. return $aResult;
  235. }
  236. /**
  237. * @page service Service Calls
  238. * @section bx_acl Paid Levels
  239. * @subsection bx_acl-payments Payments
  240. * @subsubsection bx_acl-register_cart_item register_cart_item
  241. *
  242. * @code bx_srv('bx_acl', 'register_cart_item', [...]); @endcode
  243. *
  244. * Register a processed single time payment inside the Paid Levels module. Is called with payment processing module after the payment was registered there.
  245. *
  246. * @param $iClientId client ID.
  247. * @param $iSellerId seller ID
  248. * @param $iItemId item ID.
  249. * @param $iItemCount the number of purchased items.
  250. * @param $sOrder order number received from payment provider (PayPal, Stripe, etc)
  251. * @param $sLicense license number genereted with payment processing module for internal usage
  252. * @return an array with purchased prodict's description. Empty array is returned if something is wrong.
  253. *
  254. * @see BxAclModule::serviceRegisterCartItem
  255. */
  256. /**
  257. * @ref bx_acl-register_cart_item "register_cart_item"
  258. */
  259. public function serviceRegisterCartItem($iClientId, $iSellerId, $iItemId, $iItemCount, $sOrder, $sLicense)
  260. {
  261. return $this->_serviceRegisterItem($iClientId, $iSellerId, $iItemId, $iItemCount, $sOrder, $sLicense, BX_ACL_LICENSE_TYPE_SINGLE);
  262. }
  263. /**
  264. * @page service Service Calls
  265. * @section bx_acl Paid Levels
  266. * @subsection bx_acl-payments Payments
  267. * @subsubsection bx_acl-register_subscription_item register_subscription_item
  268. *
  269. * @code bx_srv('bx_acl', 'register_subscription_item', [...]); @endcode
  270. *
  271. * Register a processed subscription (recurring payment) inside the Paid Levels module. Is called with payment processing module after the subscription was registered there.
  272. *
  273. * @param $iClientId client ID.
  274. * @param $iSellerId seller ID
  275. * @param $iItemId item ID.
  276. * @param $iItemCount the number of purchased items.
  277. * @param $sOrder order number received from payment provider (PayPal, Stripe, etc)
  278. * @param $sLicense license number genereted with payment processing module for internal usage
  279. * @return an array with subscribed prodict's description. Empty array is returned if something is wrong.
  280. *
  281. * @see BxAclModule::serviceRegisterSubscriptionItem
  282. */
  283. /**
  284. * @ref bx_acl-register_subscription_item "register_subscription_item"
  285. */
  286. public function serviceRegisterSubscriptionItem($iClientId, $iSellerId, $iItemId, $iItemCount, $sOrder, $sLicense)
  287. {
  288. return $this->_serviceRegisterItem($iClientId, $iSellerId, $iItemId, $iItemCount, $sOrder, $sLicense, BX_ACL_LICENSE_TYPE_RECURRING);
  289. }
  290. /**
  291. * @page service Service Calls
  292. * @section bx_acl Paid Levels
  293. * @subsection bx_acl-payments Payments
  294. * @subsubsection bx_acl-reregister_cart_item reregister_cart_item
  295. *
  296. * @code bx_srv('bx_acl', 'reregister_cart_item', [...]); @endcode
  297. *
  298. * Reregister a single time payment inside the Paid Levels module. Is called with payment processing module after the payment was reregistered there.
  299. *
  300. * @param $iClientId client ID.
  301. * @param $iSellerId seller ID
  302. * @param $iItemIdOld old item ID.
  303. * @param $iItemIdNew new item ID.
  304. * @param $sOrder order number received from payment provider (PayPal, Stripe, etc)
  305. * @return an array with purchased prodict's description. Empty array is returned if something is wrong.
  306. *
  307. * @see BxAclModule::serviceReregisterCartItem
  308. */
  309. /**
  310. * @ref bx_acl-reregister_cart_item "reregister_cart_item"
  311. */
  312. public function serviceReregisterCartItem($iClientId, $iSellerId, $iItemIdOld, $iItemIdNew, $sOrder)
  313. {
  314. return $this->_serviceReregisterItem($iClientId, $iSellerId, $iItemIdOld, $iItemIdNew, $sOrder, BX_ACL_LICENSE_TYPE_SINGLE);
  315. }
  316. /**
  317. * @page service Service Calls
  318. * @section bx_acl Paid Levels
  319. * @subsection bx_acl-payments Payments
  320. * @subsubsection bx_acl-reregister_subscription_item reregister_subscription_item
  321. *
  322. * @code bx_srv('bx_acl', 'reregister_subscription_item', [...]); @endcode
  323. *
  324. * Reregister a subscription (recurring payment) inside the Paid Levels module. Is called with payment processing module after the subscription was reregistered there.
  325. *
  326. * @param $iClientId client ID.
  327. * @param $iSellerId seller ID
  328. * @param $iItemIdOld old item ID.
  329. * @param $iItemIdNew new item ID.
  330. * @param $sOrder order number received from payment provider (PayPal, Stripe, etc)
  331. * @return an array with subscribed prodict's description. Empty array is returned if something is wrong.
  332. *
  333. * @see BxAclModule::serviceReregisterSubscriptionItem
  334. */
  335. /**
  336. * @ref bx_acl-reregister_subscription_item "reregister_subscription_item"
  337. */
  338. public function serviceReregisterSubscriptionItem($iClientId, $iSellerId, $iItemIdOld, $iItemIdNew, $sOrder)
  339. {
  340. return $this->_serviceReregisterItem($iClientId, $iSellerId, $iItemIdOld, $iItemIdNew, $sOrder, BX_ACL_LICENSE_TYPE_RECURRING);
  341. }
  342. /**
  343. * @page service Service Calls
  344. * @section bx_acl Paid Levels
  345. * @subsection bx_acl-payments Payments
  346. * @subsubsection bx_acl-unregister_cart_item unregister_cart_item
  347. *
  348. * @code bx_srv('bx_acl', 'unregister_cart_item', [...]); @endcode
  349. *
  350. * Unregister an earlier processed single time payment inside the Paid Levels module. Is called with payment processing module after the payment was unregistered there.
  351. *
  352. * @param $iClientId client ID.
  353. * @param $iSellerId seller ID
  354. * @param $iItemId item ID.
  355. * @param $iItemCount the number of purchased items.
  356. * @param $sOrder order number received from payment provider (PayPal, Stripe, etc)
  357. * @param $sLicense license number genereted with payment processing module for internal usage
  358. * @return boolean value determining where the payment was unregistered or not.
  359. *
  360. * @see BxAclModule::serviceUnregisterCartItem
  361. */
  362. /**
  363. * @ref bx_acl-unregister_cart_item "unregister_cart_item"
  364. */
  365. public function serviceUnregisterCartItem($iClientId, $iSellerId, $iItemId, $iItemCount, $sOrder, $sLicense)
  366. {
  367. return $this->_serviceUnregisterItem($iClientId, $iSellerId, $iItemId, $iItemCount, $sOrder, $sLicense, BX_ACL_LICENSE_TYPE_SINGLE);
  368. }
  369. /**
  370. * @page service Service Calls
  371. * @section bx_acl Paid Levels
  372. * @subsection bx_acl-payments Payments
  373. * @subsubsection bx_acl-unregister_subscription_item unregister_subscription_item
  374. *
  375. * @code bx_srv('bx_acl', 'unregister_subscription_item', [...]); @endcode
  376. *
  377. * Unregister an earlier processed subscription (recurring payment) inside the Paid Levels module. Is called with payment processing module after the subscription was unregistered there.
  378. *
  379. * @param $iClientId client ID.
  380. * @param $iSellerId seller ID
  381. * @param $iItemId item ID.
  382. * @param $iItemCount the number of purchased items.
  383. * @param $sOrder order number received from payment provider (PayPal, Stripe, etc)
  384. * @param $sLicense license number genereted with payment processing module for internal usage
  385. * @return boolean value determining where the subscription was unregistered or not.
  386. *
  387. * @see BxAclModule::serviceUnregisterSubscriptionItem
  388. */
  389. /**
  390. * @ref bx_acl-unregister_subscription_item "unregister_subscription_item"
  391. */
  392. public function serviceUnregisterSubscriptionItem($iClientId, $iSellerId, $iItemId, $iItemCount, $sOrder, $sLicense)
  393. {
  394. return $this->_serviceUnregisterItem($iClientId, $iSellerId, $iItemId, $iItemCount, $sOrder, $sLicense, BX_ACL_LICENSE_TYPE_RECURRING);
  395. }
  396. /**
  397. * @page service Service Calls
  398. * @section bx_acl Paid Levels
  399. * @subsection bx_acl-payments Payments
  400. * @subsubsection bx_acl-cancel_subscription_item cancel_subscription_item
  401. *
  402. * @code bx_srv('bx_acl', 'cancel_subscription_item', [...]); @endcode
  403. *
  404. * Cancel an earlier processed subscription (recurring payment) inside the Paid Levels module. Is called with payment processing module after the subscription was canceled there.
  405. *
  406. * @param $iClientId client ID.
  407. * @param $iSellerId seller ID
  408. * @param $iItemId item ID.
  409. * @param $iItemCount the number of purchased items.
  410. * @param $sOrder order number received from payment provider (PayPal, Stripe, etc)
  411. * @return boolean value determining where the subscription was canceled or not.
  412. *
  413. * @see BxAclModule::serviceCancelSubscriptionItem
  414. */
  415. /**
  416. * @ref bx_acl-cancel_subscription_item "cancel_subscription_item"
  417. */
  418. public function serviceCancelSubscriptionItem($iClientId, $iSellerId, $iItemId, $iItemCount, $sOrder)
  419. {
  420. //TODO: Do something if it's necessary.
  421. return true;
  422. }
  423. /**
  424. * @page service Service Calls
  425. * @section bx_acl Paid Levels
  426. * @subsection bx_acl-other Other
  427. * @subsubsection bx_acl-get_prices get_prices
  428. *
  429. * @code bx_srv('bx_acl', 'get_prices', [...]); @endcode
  430. *
  431. * Get array of available price options for membership levels
  432. *
  433. * @param $iLevelId membership level id
  434. * @param $bFreeUnlimitedOnly get unlimited free pricing options only
  435. * @return array of levels, or empty array of there are no any pricing options avaiulable
  436. *
  437. * @see BxAclModule::serviceGetPrices
  438. */
  439. /**
  440. * @ref bx_acl-get_prices "get_prices"
  441. */
  442. public function serviceGetPrices($iLevelId = 0, $bFreeUnlimitedOnly = false)
  443. {
  444. $aParams = array(
  445. 'type' => $iLevelId ? 'by_level_id' : 'all_full',
  446. 'value' => $iLevelId,
  447. );
  448. $aPrices = $this->_oDb->getPrices($aParams, false);
  449. return array_filter($aPrices, function ($r) use ($bFreeUnlimitedOnly) {
  450. return $bFreeUnlimitedOnly ? !$r['price'] && !$r['period'] : true;
  451. });
  452. }
  453. protected function _serviceRegisterItem($iClientId, $iSellerId, $iItemId, $iItemCount, $sOrder, $sLicense, $sType)
  454. {
  455. $CNF = &$this->_oConfig->CNF;
  456. $aItem = $this->serviceGetCartItem($iItemId);
  457. if(empty($aItem) || !is_array($aItem))
  458. return array();
  459. $oAcl = BxDolAcl::getInstance();
  460. $aItemInfo = $this->_oDb->getPrices(array('type' => 'by_id', 'value' => $iItemId));
  461. $aMembershipInfo = $oAcl->getMemberMembershipInfo($iClientId);
  462. $aPeriod = array('period' => (int)$aItemInfo['period'], 'period_unit' => $aItemInfo['period_unit']);
  463. if($sType == BX_ACL_LICENSE_TYPE_RECURRING && (int)$aItemInfo['trial'] > 0 && (int)$aItemInfo['level_id'] != (int)$aMembershipInfo['id'])
  464. $aPeriod = array('period' => (int)$aItemInfo['trial'], 'period_unit' => 'day');
  465. $iReserve = (int)getParam($CNF['PARAM_RECURRING_RESERVE']);
  466. if(!empty($iReserve))
  467. $aPeriod['period_reserve'] = $iReserve;
  468. if(!$oAcl->setMembership($iClientId, $aItemInfo['level_id'], $aPeriod, true, $sLicense))
  469. return array();
  470. return $aItem;
  471. }
  472. protected function _serviceReregisterItem($iClientId, $iSellerId, $iItemIdOld, $iItemIdNew, $sOrder, $sType)
  473. {
  474. $aItemNew = $this->serviceGetCartItem($iItemIdNew);
  475. if(empty($aItemNew) || !is_array($aItemNew))
  476. return array();
  477. /*
  478. * Note. Membership level cannot be reregistered immediately.
  479. * it will be automatically changed in the end of current period.
  480. */
  481. return $aItemNew;
  482. }
  483. protected function _serviceUnregisterItem($iClientId, $iSellerId, $iItemId, $iItemCount, $sOrder, $sLicense, $sType)
  484. {
  485. $aItemInfo = $this->_oDb->getPrices(array('type' => 'by_id', 'value' => $iItemId));
  486. if(empty($aItemInfo) || !is_array($aItemInfo))
  487. return false;
  488. return BxDolAcl::getInstance()->unsetMembership($iClientId, $aItemInfo['level_id'], $sLicense);
  489. }
  490. /**
  491. * COMMON METHODS
  492. */
  493. public function getUserId()
  494. {
  495. return isLogged() ? bx_get_logged_profile_id() : 0;
  496. }
  497. public function getUserInfo($iUserId = 0)
  498. {
  499. $oProfile = BxDolProfile::getInstance($iUserId);
  500. if (!$oProfile)
  501. $oProfile = BxDolProfileUndefined::getInstance();
  502. return array(
  503. $oProfile->getDisplayName(),
  504. $oProfile->getUrl(),
  505. $oProfile->getThumb(),
  506. $oProfile->getUnit()
  507. );
  508. }
  509. }
  510. /** @} */