Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Data.php
Go to the documentation of this file.
1 <?php
7 
9 
16 {
24  public function getIsShareable($link)
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  }
40 }