/** * Set package object * * @return $this * @throws \Magento\Framework\Model\Exception */ public function generatePackageXml() { $this->_session->setLocalExtensionPackageFormData($this->getData()); $this->_setPackage()->_setRelease()->_setAuthors()->_setDependencies()->_setContents(); if (!$this->getPackage()->validate()) { $message = $this->getPackage()->getErrors(); throw new \Magento\Framework\Model\Exception(__($message[0])); } $this->setPackageXml($this->getPackage()->getPackageXml()); return $this; }
/** * @param \Magento\Backend\Block\Template\Context $context * @param \Magento\Framework\Registry $registry * @param \Magento\Framework\Data\FormFactory $formFactory * @param \Magento\Connect\Model\Session $session * @param array $data */ public function __construct(\Magento\Backend\Block\Template\Context $context, \Magento\Framework\Registry $registry, \Magento\Framework\Data\FormFactory $formFactory, \Magento\Connect\Model\Session $session, array $data = array()) { parent::__construct($context, $registry, $formFactory, $data); $this->setData($session->getCustomExtensionPackageFormData()); }