Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions
Data Class Reference
Inheritance diagram for Data:
AbstractHelper

Public Member Functions

 getIsShareable ($link)
 
- Public Member Functions inherited from AbstractHelper
 __construct (Context $context)
 
 isModuleOutputEnabled ($moduleName=null)
 

Additional Inherited Members

- Protected Member Functions inherited from AbstractHelper
 _getRequest ()
 
 _getModuleName ()
 
 _getUrl ($route, $params=[])
 
- Protected Attributes inherited from AbstractHelper
 $_moduleName
 
 $_request
 
 $_moduleManager
 
 $_logger
 
 $_urlBuilder
 
 $_httpHeader
 
 $_eventManager
 
 $_remoteAddress
 
 $urlEncoder
 
 $urlDecoder
 
 $scopeConfig
 
 $_cacheConfig
 

Detailed Description

Downloadable helper

Author
Magento Core Team core@.nosp@m.mage.nosp@m.ntoco.nosp@m.mmer.nosp@m.ce.co.nosp@m.m

Definition at line 15 of file Data.php.

Member Function Documentation

◆ getIsShareable()

getIsShareable (   $link)

Check is link shareable or not

Parameters
\Magento\Downloadable\Model\Link | Item$link
Returns
bool @SuppressWarnings(PHPMD.BooleanGetMethodName)

Definition at line 24 of file Data.php.

25  {
26  $shareable = false;
27  switch ($link->getIsShareable()) {
28  case \Magento\Downloadable\Model\Link::LINK_SHAREABLE_YES:
29  case \Magento\Downloadable\Model\Link::LINK_SHAREABLE_NO:
30  $shareable = (bool)$link->getIsShareable();
31  break;
32  case \Magento\Downloadable\Model\Link::LINK_SHAREABLE_CONFIG:
33  $shareable = (bool)$this->scopeConfig->isSetFlag(
34  \Magento\Downloadable\Model\Link::XML_PATH_CONFIG_IS_SHAREABLE,
35  \Magento\Store\Model\ScopeInterface::SCOPE_STORE
36  );
37  }
38  return $shareable;
39  }

The documentation for this class was generated from the following file: