コード例 #1
0
ファイル: Builder.php プロジェクト: Doability/magento2dev
 /**
  * @return Link
  */
 private function getComponent()
 {
     if (!$this->component) {
         $this->component = $this->componentFactory->create();
     }
     return $this->component;
 }
コード例 #2
0
ファイル: LinkRepository.php プロジェクト: tingyeeh/magento2
 /**
  * {@inheritdoc}
  */
 public function delete($id)
 {
     /** @var $link \Magento\Downloadable\Model\Link */
     $link = $this->linkFactory->create()->load($id);
     if (!$link->getId()) {
         throw new NoSuchEntityException(__('There is no downloadable link with provided ID.'));
     }
     $link->delete();
     return true;
 }
コード例 #3
0
ファイル: LinkRepository.php プロジェクト: rafaelstz/magento2
 /**
  * {@inheritdoc}
  */
 public function delete($id)
 {
     /** @var $link \Magento\Downloadable\Model\Link */
     $link = $this->linkFactory->create()->load($id);
     if (!$link->getId()) {
         throw new NoSuchEntityException(__('There is no downloadable link with provided ID.'));
     }
     try {
         $link->delete();
     } catch (\Exception $exception) {
         throw new StateException(__('Cannot delete link with id %1', $link->getId()), $exception);
     }
     return true;
 }
コード例 #4
0
ファイル: Type.php プロジェクト: nja78/magento2
 /**
  * @return \Magento\Downloadable\Model\Link
  */
 protected function _createLink()
 {
     return $this->_linkFactory->create();
 }