Esempio n. 1
0
 /**
  * Return ProductCustomOptionRepository
  *
  * @return ProductCustomOptionRepositoryInterface
  * @deprecated
  */
 private function getProductOptionRepository()
 {
     if (!$this->productOptionRepository) {
         $this->productOptionRepository = ObjectManager::getInstance()->get(ProductCustomOptionRepositoryInterface::class);
     }
     return $this->productOptionRepository;
 }
 public function __wakeup()
 {
     $this->pluginLocator = \Magento\Framework\App\ObjectManager::getInstance();
     $this->pluginList = $this->pluginLocator->get('Magento\\Framework\\Interception\\PluginList');
     $this->chain = $this->pluginLocator->get('Magento\\Framework\\Interception\\Chain');
     $this->subjectType = get_parent_class($this);
 }
Esempio n. 3
0
 /**
  * @return CollectionFactoryInterface
  *
  * @deprecated
  */
 private function getOrderCollectionFactory()
 {
     if ($this->orderCollectionFactory === null) {
         $this->orderCollectionFactory = ObjectManager::getInstance()->get(CollectionFactoryInterface::class);
     }
     return $this->orderCollectionFactory;
 }
 /**
  * Get config validator
  *
  * @return Design\Config\Validator
  *
  * @deprecated
  */
 private function getValidator()
 {
     if (null === $this->validator) {
         $this->validator = \Magento\Framework\App\ObjectManager::getInstance()->get(\Magento\Theme\Model\Design\Config\Validator::class);
     }
     return $this->validator;
 }
Esempio n. 5
0
 public function isAuthorized()
 {
     $om = \Magento\Framework\App\ObjectManager::getInstance();
     $session = $om->get('Magento\\Framework\\App\\Http\\Context');
     $isLoggedIn = $session->getValue(\Magento\Customer\Model\Context::CONTEXT_AUTH);
     return $isLoggedIn;
 }
Esempio n. 6
0
 /**
  * @return \Magento\Framework\Data\Form\FormKey\Validator
  * @deprecated
  */
 private function getFormKeyValidator()
 {
     if (!$this->formKeyValidator) {
         $this->formKeyValidator = \Magento\Framework\App\ObjectManager::getInstance()->get(\Magento\Framework\Data\Form\FormKey\Validator::class);
     }
     return $this->formKeyValidator;
 }
 /**
  * Get Data Persistor
  *
  * @return DataPersistorInterface
  */
 private function getDataPersistor()
 {
     if ($this->dataPersistor === null) {
         $this->dataPersistor = ObjectManager::getInstance()->get(DataPersistorInterface::class);
     }
     return $this->dataPersistor;
 }
Esempio n. 8
0
 /**
  * Get image uploader
  *
  * @return \Magento\Catalog\Model\ImageUploader
  *
  * @deprecated
  */
 private function getImageUploader()
 {
     if ($this->imageUploader === null) {
         $this->imageUploader = \Magento\Framework\App\ObjectManager::getInstance()->get('Fastgento\\Storelocator\\LocationImageUpload');
     }
     return $this->imageUploader;
 }
 protected function _construct()
 {
     if ($this->checkConfig()) {
         $page = \Magento\Framework\App\ObjectManager::getInstance()->get('Magento\\Framework\\View\\Page\\Config');
         $page->addPageAsset('Mageplaza_Blog::css/index/mp.css');
     }
 }
Esempio n. 10
0
 public function getCustomerId()
 {
     $om = \Magento\Framework\App\ObjectManager::getInstance();
     $session = $om->get('Magento\\Customer\\Model\\Session')->getCustomerId();
     //$customerId = $session->getId();
     return $session;
 }
Esempio n. 11
0
 /**
  * @return Option\Repository
  */
 private function getOptionRepository()
 {
     if (null === $this->optionRepository) {
         $this->optionRepository = \Magento\Framework\App\ObjectManager::getInstance()->get('Magento\\Catalog\\Model\\Product\\Option\\Repository');
     }
     return $this->optionRepository;
 }
Esempio n. 12
0
 protected function _construct()
 {
     $this->_init('Celebros\\Celexport\\Model\\ResourceModel\\Cronlog');
     $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
     $this->_timezone = $objectManager->create('Magento\\Framework\\Stdlib\\DateTime\\TimezoneInterface');
     $this->helper = $objectManager->create('Celebros\\Celexport\\Helper\\Data');
 }
Esempio n. 13
0
 /**
  * Get MetadataPool instance
  * @return MetadataPool
  */
 private function getMetadataPool()
 {
     if (!$this->metadataPool) {
         $this->metadataPool = ObjectManager::getInstance()->get(MetadataPool::class);
     }
     return $this->metadataPool;
 }
Esempio n. 14
0
 /**
  * @return \Magento\Framework\Math\Random
  *
  * @deprecated
  */
 private function getMathRandom()
 {
     if ($this->mathRandom === null) {
         $this->mathRandom = \Magento\Framework\App\ObjectManager::getInstance()->get('\\Magento\\Framework\\Math\\Random');
     }
     return $this->mathRandom;
 }
Esempio n. 15
0
 /**
  * The getter function to get the new NameFinder dependency
  *
  * @return NameFinder
  *
  * @deprecated
  */
 private function getNameFinder()
 {
     if ($this->nameFinder === null) {
         $this->nameFinder = \Magento\Framework\App\ObjectManager::getInstance()->get('\\Magento\\Framework\\Reflection\\NameFinder');
     }
     return $this->nameFinder;
 }
Esempio n. 16
0
 /**
  * The getter function to get the attributeHelper for real application code
  *
  * @deprecated
  *
  * @return Attribute
  */
 private function getAttributeHelper()
 {
     if ($this->attributeHelper === null) {
         $this->attributeHelper = ObjectManager::getInstance()->get('Magento\\Eav\\Model\\Entity\\Attribute');
     }
     return $this->attributeHelper;
 }
Esempio n. 17
0
 /**
  * @return RequestInterface
  */
 private function getRequest()
 {
     if ($this->request === null) {
         $this->request = \Magento\Framework\App\ObjectManager::getInstance()->get(RequestInterface::class);
     }
     return $this->request;
 }
 public function getItmeProductThumbnailUrl()
 {
     $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
     $thumbnailHelper = $objectManager->get('Magento\\Catalog\\Helper\\Image');
     $thumbnail = $thumbnailHelper->init($this->getItmeProduct(), 'thumbnail')->constrainOnly(true)->keepAspectRatio(true)->keepFrame(false)->setImageFile($this->getItmeProduct()->getImage())->resize('160', '160')->getUrl();
     return $thumbnail;
 }
 /**
  * @return AnchorUrlRewriteGenerator
  *
  * @deprecated
  */
 private function getAnchorUrlRewriteGenerator()
 {
     if ($this->anchorUrlRewriteGenerator === null) {
         $this->anchorUrlRewriteGenerator = \Magento\Framework\App\ObjectManager::getInstance()->get('Magento\\CatalogUrlRewrite\\Model\\Product\\AnchorUrlRewriteGenerator');
     }
     return $this->anchorUrlRewriteGenerator;
 }
Esempio n. 20
0
 /**
  * Get image uploader
  *
  * @return \Magento\Catalog\Model\ImageUploader
  *
  * @deprecated
  */
 private function getImageUploader()
 {
     if ($this->imageUploader === null) {
         $this->imageUploader = \Magento\Framework\App\ObjectManager::getInstance()->get('Magento\\Catalog\\CategoryImageUpload');
     }
     return $this->imageUploader;
 }
Esempio n. 21
0
 /**
  * Retrieve cookie metadata factory
  *
  * @deprecated
  * @return CookieMetadataFactory
  */
 private function getCookieMetadataFactory()
 {
     if (!$this->cookieMetadataFactory) {
         $this->cookieMetadataFactory = ObjectManager::getInstance()->get(CookieMetadataFactory::class);
     }
     return $this->cookieMetadataFactory;
 }
Esempio n. 22
0
 /**
  * Tests that the session handler is correctly set when object is created.
  *
  * @dataProvider saveHandlerProvider
  * @param string $deploymentConfigHandler
  * @param string $iniHandler
  */
 public function testSetSaveHandler($deploymentConfigHandler, $iniHandler)
 {
     // Set expected session.save_handler config
     if ($deploymentConfigHandler) {
         if ($deploymentConfigHandler !== 'files') {
             $expected = 'user';
         } else {
             $expected = $deploymentConfigHandler;
         }
     } else {
         if ($iniHandler) {
             $expected = $iniHandler;
         } else {
             $expected = SaveHandlerInterface::DEFAULT_HANDLER;
         }
     }
     // Set ini configuration
     if ($iniHandler) {
         ini_set('session.save_handler', $iniHandler);
     }
     /** @var DeploymentConfig | \PHPUnit_Framework_MockObject_MockObject $deploymentConfigMock */
     $deploymentConfigMock = $this->getMockBuilder(DeploymentConfig::class)->disableOriginalConstructor()->getMock();
     $deploymentConfigMock->expects($this->once())->method('get')->with(Config::PARAM_SESSION_SAVE_METHOD, SaveHandlerInterface::DEFAULT_HANDLER)->willReturn($deploymentConfigHandler ?: SaveHandlerInterface::DEFAULT_HANDLER);
     new SaveHandler(ObjectManager::getInstance()->get(SaveHandlerFactory::class), $deploymentConfigMock);
     // Test expectation
     $this->assertEquals($expected, ObjectManager::getInstance()->get(ConfigInterface::class)->getOption('session.save_handler'));
 }
Esempio n. 23
0
 /**
  * {@inheritdoc}
  */
 public function __wakeup()
 {
     parent::__wakeup();
     $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
     $this->_resource = $objectManager->get('Magento\\Authorization\\Model\\ResourceModel\\Role');
     $this->_resourceCollection = $objectManager->get('Magento\\Authorization\\Model\\ResourceModel\\Role\\Collection');
 }
 /**
  * @return ObjectManager
  */
 private function initObjectManager()
 {
     if (is_null($this->objectManager)) {
         $this->objectManager = ObjectManager::getInstance();
     }
     return $this->objectManager;
 }
 /**
  * Get HttpClientFactory dependency
  *
  * @return \Magento\Framework\HTTP\ZendClientFactory
  *
  * @deprecated
  */
 private function getHttpClientFactory()
 {
     if ($this->httpClientFactory === null) {
         $this->httpClientFactory = \Magento\Framework\App\ObjectManager::getInstance()->get('Magento\\Framework\\HTTP\\ZendClientFactory');
     }
     return $this->httpClientFactory;
 }
Esempio n. 26
0
 /**
  * Prepare form fields
  *
  * @return \Magento\Backend\Block\Widget\Form
  */
 protected function _prepareForm()
 {
     $form = $this->_formFactory->create();
     $form->setHtmlIdPrefix('manufacturer_');
     $form->setFieldNameSuffix('manufacturer');
     $model = $this->_coreRegistry->registry('manufacturer_manufacturer');
     $om = \Magento\Framework\App\ObjectManager::getInstance();
     $reader = $om->get('Magento\\Eav\\Model\\Config')->getAttribute('catalog_product', 'manufacturer');
     $attributeOptions = $reader->getSource()->getAllOptions(true, true);
     $default = array('value' => '', 'label' => 'Choose Brand');
     $i = 0;
     $manufacturer[$i] = $default;
     foreach ($attributeOptions as $key => $value) {
         $i++;
         if ($key != 0) {
             $manufacturer[$i] = $value;
             //$name[$i] = $value['label'];
         }
     }
     $fieldset = $form->addFieldset('base_fieldset', ['legend' => __('General')]);
     if ($model->getId()) {
         $fieldset->addField('id', 'hidden', ['name' => 'id']);
     }
     $fieldset->addField('mfc_id', 'select', ['name' => 'mfc_id', 'label' => __('Manufacturer'), 'required' => true, 'values' => $manufacturer]);
     $fieldset->addField('status', 'select', ['name' => 'status', 'label' => __('Status'), 'options' => $this->_manufacturerStatus->toOptionArray()]);
     $fieldset->addField('position', 'textarea', ['name' => 'position', 'label' => __('Position'), 'required' => true, 'style' => 'height: 15em; width: 30em;']);
     $fieldset->addField('image_path', 'image', array('name' => 'image_path', 'label' => __('Image'), 'title' => __('Image')));
     $wysiwygConfig = $this->_wysiwygConfig->getConfig();
     $fieldset->addField('description', 'editor', ['name' => 'description', 'label' => __('Description'), 'required' => true, 'config' => $wysiwygConfig]);
     $data = $model->getData();
     $form->setValues($data);
     $this->setForm($form);
     return parent::_prepareForm();
 }
Esempio n. 27
0
 /**
  * The getter function to get the new RuleFactory dependency
  *
  * @return \Magento\SalesRule\Model\RuleFactory
  *
  * @deprecated
  */
 private function getRuleFactory()
 {
     if ($this->ruleFactory === null) {
         $this->ruleFactory = ObjectManager::getInstance()->get('Magento\\SalesRule\\Model\\RuleFactory');
     }
     return $this->ruleFactory;
 }
Esempio n. 28
0
 public function createTestimonialAction()
 {
     $data = $this->getRequest()->getPost();
     $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
     $testimonial = $objectManager->get('V3N0m21\\Testimonials\\Model\\Testimonial');
     $testimonial->setId();
 }
Esempio n. 29
0
 public function execute()
 {
     $result = $this->resultJsonFactory->create();
     $data = array();
     try {
         $params = $this->getRequest()->getParams();
         if (isset($params['lastid']) && isset($params['limit'])) {
             $lastId = $params['lastid'];
             $limit = $params['limit'];
             $isadmin = isset($params['isadmin']) ? $params['isadmin'] : false;
             $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
             $raaDataHelper = $objectManager->create('Retail\\Analytics\\Helper\\Data');
             $width = $raaDataHelper->getImageWidth();
             $height = $raaDataHelper->getImageHeight();
             $imagetype = "small_image";
             if (isset($params['width']) && $params['width'] != null && $params['width'] != "") {
                 $width = $params['width'];
             }
             if (isset($params['height']) && $params['height'] != null && $params['height'] != "") {
                 $height = $params['height'];
             }
             if (isset($params['imagetype']) && $params['imagetype'] != null && $params['imagetype'] != "") {
                 $imagetype = $params['imagetype'];
             }
             $producCollection = new \Retail\Analytics\Model\Product();
             $data = $producCollection->getProductFinalPrice($lastId, $limit, $imagetype, $width, $height, $isadmin);
             return $result->setData($data);
         }
     } catch (Exception $e) {
         return $result->setData($data);
     }
 }
 /**
  * Gets base URL checker.
  *
  * @return \Magento\Store\Model\BaseUrlChecker
  * @deprecated
  */
 private function getBaseUrlChecker()
 {
     if ($this->baseUrlChecker === null) {
         $this->baseUrlChecker = \Magento\Framework\App\ObjectManager::getInstance()->get('Magento\\Store\\Model\\BaseUrlChecker');
     }
     return $this->baseUrlChecker;
 }