Create Construct Function Magento2 Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?Magento 2: Plugin class does not existUnable to create order from admin in magento 2Magento offline custom Payment method with drop down listMagento 2 Create dynamic array From different Model Collection to use in multi select in gridunable to solve the error in magento2Magento 2.3 Can't view module's front end page output?Magento2 REST API get all customers detailsPHP Fatal error: Uncaught TypeError: Argument 1 passed to Magento\Framework\Data\Collection\AbstractDb::setConnection() must implement interfaceIncompatible argument type error during compilation in Magento2.2.5?Add Construct In This Class

What LEGO pieces have "real-world" functionality?

Cold is to Refrigerator as warm is to?

What is the electric potential inside a point charge?

How to market an anarchic city as a tourism spot to people living in civilized areas?

Why don't the Weasley twins use magic outside of school if the Trace can only find the location of spells cast?

grandmas drink with lemon juice

How do you clear the ApexPages.getMessages() collection in a test?

Classification of bundles, Postnikov towers, obstruction theory, local coefficients

If A makes B more likely then B makes A more likely"

Why use gamma over alpha radiation?

Why does tar appear to skip file contents when output file is /dev/null?

Strange behaviour of Check

Do working physicists consider Newtonian mechanics to be "falsified"?

How can you insert a "times/divide" symbol similar to the "plus/minus" (±) one?

What is the order of Mitzvot in Rambam's Sefer Hamitzvot?

Slither Like a Snake

Can I add database to AWS RDS MySQL without creating new instance?

How to set letter above or below the symbol?

What do I do if technical issues prevent me from filing my return on time?

What items from the Roman-age tech-level could be used to deter all creatures from entering a small area?

How many things? AとBがふたつ

Are my PIs rude or am I just being too sensitive?

Is above average number of years spent on PhD considered a red flag in future academia or industry positions?

Using "nakedly" instead of "with nothing on"



Create Construct Function Magento2



Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)
Announcing the arrival of Valued Associate #679: Cesar Manara
Unicorn Meta Zoo #1: Why another podcast?Magento 2: Plugin class does not existUnable to create order from admin in magento 2Magento offline custom Payment method with drop down listMagento 2 Create dynamic array From different Model Collection to use in multi select in gridunable to solve the error in magento2Magento 2.3 Can't view module's front end page output?Magento2 REST API get all customers detailsPHP Fatal error: Uncaught TypeError: Argument 1 passed to Magento\Framework\Data\Collection\AbstractDb::setConnection() must implement interfaceIncompatible argument type error during compilation in Magento2.2.5?Add Construct In This Class



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















i want to create class construct function in this model this is payment model PaymentMethod extends MagentoPaymentModelMethodAbstractMethod i try but getting an error what wrong I am doing.



use MagentoFrameworkDataObject;
use MagentoPaymentModelInfoInterface;
use MagentoPaymentModelMethodInterface;
use MagentoPaymentObserverAbstractDataAssignObserver;
use MagentoQuoteApiDataPaymentMethodInterface;
use MagentoSalesModelOrderPayment;
use CryozonicStripePaymentsHelperLogger;

public function __construct(
MagentoFrameworkModelContext $context,
MagentoFrameworkRegistry $registry,
MagentoFrameworkApiExtensionAttributesFactory $extensionFactory,
MagentoFrameworkApiAttributeValueFactory $customAttributeFactory,
MagentoPaymentHelperData $paymentData,
MagentoFrameworkAppConfigScopeConfigInterface $scopeConfig,
MagentoPaymentModelMethodLogger $logger,
MagentoFrameworkModelResourceModelAbstractResource $resource = null,
MagentoFrameworkDataCollectionAbstractDb $resourceCollection = null,
array $data = []
)
parent::__construct(
$context,
$registry,
$extensionFactory,
$customAttributeFactory,
$resource,
$resourceCollection,
$data
);
$this->_paymentData = $paymentData;
$this->_scopeConfig = $scopeConfig;
$this->logger = $logger;
$this->initializeData($data);










share|improve this question






























    0















    i want to create class construct function in this model this is payment model PaymentMethod extends MagentoPaymentModelMethodAbstractMethod i try but getting an error what wrong I am doing.



    use MagentoFrameworkDataObject;
    use MagentoPaymentModelInfoInterface;
    use MagentoPaymentModelMethodInterface;
    use MagentoPaymentObserverAbstractDataAssignObserver;
    use MagentoQuoteApiDataPaymentMethodInterface;
    use MagentoSalesModelOrderPayment;
    use CryozonicStripePaymentsHelperLogger;

    public function __construct(
    MagentoFrameworkModelContext $context,
    MagentoFrameworkRegistry $registry,
    MagentoFrameworkApiExtensionAttributesFactory $extensionFactory,
    MagentoFrameworkApiAttributeValueFactory $customAttributeFactory,
    MagentoPaymentHelperData $paymentData,
    MagentoFrameworkAppConfigScopeConfigInterface $scopeConfig,
    MagentoPaymentModelMethodLogger $logger,
    MagentoFrameworkModelResourceModelAbstractResource $resource = null,
    MagentoFrameworkDataCollectionAbstractDb $resourceCollection = null,
    array $data = []
    )
    parent::__construct(
    $context,
    $registry,
    $extensionFactory,
    $customAttributeFactory,
    $resource,
    $resourceCollection,
    $data
    );
    $this->_paymentData = $paymentData;
    $this->_scopeConfig = $scopeConfig;
    $this->logger = $logger;
    $this->initializeData($data);










    share|improve this question


























      0












      0








      0








      i want to create class construct function in this model this is payment model PaymentMethod extends MagentoPaymentModelMethodAbstractMethod i try but getting an error what wrong I am doing.



      use MagentoFrameworkDataObject;
      use MagentoPaymentModelInfoInterface;
      use MagentoPaymentModelMethodInterface;
      use MagentoPaymentObserverAbstractDataAssignObserver;
      use MagentoQuoteApiDataPaymentMethodInterface;
      use MagentoSalesModelOrderPayment;
      use CryozonicStripePaymentsHelperLogger;

      public function __construct(
      MagentoFrameworkModelContext $context,
      MagentoFrameworkRegistry $registry,
      MagentoFrameworkApiExtensionAttributesFactory $extensionFactory,
      MagentoFrameworkApiAttributeValueFactory $customAttributeFactory,
      MagentoPaymentHelperData $paymentData,
      MagentoFrameworkAppConfigScopeConfigInterface $scopeConfig,
      MagentoPaymentModelMethodLogger $logger,
      MagentoFrameworkModelResourceModelAbstractResource $resource = null,
      MagentoFrameworkDataCollectionAbstractDb $resourceCollection = null,
      array $data = []
      )
      parent::__construct(
      $context,
      $registry,
      $extensionFactory,
      $customAttributeFactory,
      $resource,
      $resourceCollection,
      $data
      );
      $this->_paymentData = $paymentData;
      $this->_scopeConfig = $scopeConfig;
      $this->logger = $logger;
      $this->initializeData($data);










      share|improve this question
















      i want to create class construct function in this model this is payment model PaymentMethod extends MagentoPaymentModelMethodAbstractMethod i try but getting an error what wrong I am doing.



      use MagentoFrameworkDataObject;
      use MagentoPaymentModelInfoInterface;
      use MagentoPaymentModelMethodInterface;
      use MagentoPaymentObserverAbstractDataAssignObserver;
      use MagentoQuoteApiDataPaymentMethodInterface;
      use MagentoSalesModelOrderPayment;
      use CryozonicStripePaymentsHelperLogger;

      public function __construct(
      MagentoFrameworkModelContext $context,
      MagentoFrameworkRegistry $registry,
      MagentoFrameworkApiExtensionAttributesFactory $extensionFactory,
      MagentoFrameworkApiAttributeValueFactory $customAttributeFactory,
      MagentoPaymentHelperData $paymentData,
      MagentoFrameworkAppConfigScopeConfigInterface $scopeConfig,
      MagentoPaymentModelMethodLogger $logger,
      MagentoFrameworkModelResourceModelAbstractResource $resource = null,
      MagentoFrameworkDataCollectionAbstractDb $resourceCollection = null,
      array $data = []
      )
      parent::__construct(
      $context,
      $registry,
      $extensionFactory,
      $customAttributeFactory,
      $resource,
      $resourceCollection,
      $data
      );
      $this->_paymentData = $paymentData;
      $this->_scopeConfig = $scopeConfig;
      $this->logger = $logger;
      $this->initializeData($data);







      magento2






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited yesterday









      Amit Bera

      60k1677178




      60k1677178










      asked yesterday









      tgetge

      34




      34




















          1 Answer
          1






          active

          oldest

          votes


















          0














          If you extend MagentoPaymentModelMethodAbstractMethod then your __construct function should have followed below classes parameters



           MagentoFrameworkModelContext $context,
          MagentoFrameworkRegistry $registry,
          MagentoFrameworkApiExtensionAttributesFactory $extensionFactory,
          MagentoFrameworkApiAttributeValueFactory $customAttributeFactory,
          MagentoPaymentHelperData $paymentData,
          MagentoFrameworkAppConfigScopeConfigInterface $scopeConfig,
          Logger $logger,
          MagentoFrameworkModelResourceModelAbstractResource $resource = null,
          MagentoFrameworkDataCollectionAbstractDb $resourceCollection = null,
          array $data = [],
          DirectoryHelper $directory = null


          So, your __construct have minimum below code



           <?php

          namespace YourNameSpace;

          use MagentoDirectoryHelperData as DirectoryHelper;
          use CryozonicStripePaymentsHelperLogger;

          class YourClass extends MagentoPaymentModelMethodAbstractMethod

          public function __construct(
          MagentoFrameworkModelContext $context,
          MagentoFrameworkRegistry $registry,
          MagentoFrameworkApiExtensionAttributesFactory $extensionFactory,
          MagentoFrameworkApiAttributeValueFactory $customAttributeFactory,
          MagentoPaymentHelperData $paymentData,
          MagentoFrameworkAppConfigScopeConfigInterface $scopeConfig,
          MagentoPaymentModelMethodLogger $logger,
          MagentoFrameworkModelResourceModelAbstractResource $resource = null,
          MagentoFrameworkDataCollectionAbstractDb $resourceCollection = null,
          array $data = [],
          DirectoryHelper $directory = null
          )
          parent::__construct(
          $context,
          $registry,
          $extensionFactory,
          $customAttributeFactory,
          $paymentData,
          $scopeConfig,
          $logger,
          $resource,
          $resourceCollection,
          $data,
          $directory
          );







          share|improve this answer

























          • not working for me

            – tge
            yesterday











          • share your code

            – Amit Bera
            yesterday











          • see my question i updated

            – tge
            yesterday











          • see my code? need help

            – tge
            yesterday






          • 1





            Answer updated and YourNameSpace & YourClass with your namespace & class repectively.

            – Amit Bera
            yesterday











          Your Answer








          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "479"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f269957%2fcreate-construct-function-magento2%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          If you extend MagentoPaymentModelMethodAbstractMethod then your __construct function should have followed below classes parameters



           MagentoFrameworkModelContext $context,
          MagentoFrameworkRegistry $registry,
          MagentoFrameworkApiExtensionAttributesFactory $extensionFactory,
          MagentoFrameworkApiAttributeValueFactory $customAttributeFactory,
          MagentoPaymentHelperData $paymentData,
          MagentoFrameworkAppConfigScopeConfigInterface $scopeConfig,
          Logger $logger,
          MagentoFrameworkModelResourceModelAbstractResource $resource = null,
          MagentoFrameworkDataCollectionAbstractDb $resourceCollection = null,
          array $data = [],
          DirectoryHelper $directory = null


          So, your __construct have minimum below code



           <?php

          namespace YourNameSpace;

          use MagentoDirectoryHelperData as DirectoryHelper;
          use CryozonicStripePaymentsHelperLogger;

          class YourClass extends MagentoPaymentModelMethodAbstractMethod

          public function __construct(
          MagentoFrameworkModelContext $context,
          MagentoFrameworkRegistry $registry,
          MagentoFrameworkApiExtensionAttributesFactory $extensionFactory,
          MagentoFrameworkApiAttributeValueFactory $customAttributeFactory,
          MagentoPaymentHelperData $paymentData,
          MagentoFrameworkAppConfigScopeConfigInterface $scopeConfig,
          MagentoPaymentModelMethodLogger $logger,
          MagentoFrameworkModelResourceModelAbstractResource $resource = null,
          MagentoFrameworkDataCollectionAbstractDb $resourceCollection = null,
          array $data = [],
          DirectoryHelper $directory = null
          )
          parent::__construct(
          $context,
          $registry,
          $extensionFactory,
          $customAttributeFactory,
          $paymentData,
          $scopeConfig,
          $logger,
          $resource,
          $resourceCollection,
          $data,
          $directory
          );







          share|improve this answer

























          • not working for me

            – tge
            yesterday











          • share your code

            – Amit Bera
            yesterday











          • see my question i updated

            – tge
            yesterday











          • see my code? need help

            – tge
            yesterday






          • 1





            Answer updated and YourNameSpace & YourClass with your namespace & class repectively.

            – Amit Bera
            yesterday















          0














          If you extend MagentoPaymentModelMethodAbstractMethod then your __construct function should have followed below classes parameters



           MagentoFrameworkModelContext $context,
          MagentoFrameworkRegistry $registry,
          MagentoFrameworkApiExtensionAttributesFactory $extensionFactory,
          MagentoFrameworkApiAttributeValueFactory $customAttributeFactory,
          MagentoPaymentHelperData $paymentData,
          MagentoFrameworkAppConfigScopeConfigInterface $scopeConfig,
          Logger $logger,
          MagentoFrameworkModelResourceModelAbstractResource $resource = null,
          MagentoFrameworkDataCollectionAbstractDb $resourceCollection = null,
          array $data = [],
          DirectoryHelper $directory = null


          So, your __construct have minimum below code



           <?php

          namespace YourNameSpace;

          use MagentoDirectoryHelperData as DirectoryHelper;
          use CryozonicStripePaymentsHelperLogger;

          class YourClass extends MagentoPaymentModelMethodAbstractMethod

          public function __construct(
          MagentoFrameworkModelContext $context,
          MagentoFrameworkRegistry $registry,
          MagentoFrameworkApiExtensionAttributesFactory $extensionFactory,
          MagentoFrameworkApiAttributeValueFactory $customAttributeFactory,
          MagentoPaymentHelperData $paymentData,
          MagentoFrameworkAppConfigScopeConfigInterface $scopeConfig,
          MagentoPaymentModelMethodLogger $logger,
          MagentoFrameworkModelResourceModelAbstractResource $resource = null,
          MagentoFrameworkDataCollectionAbstractDb $resourceCollection = null,
          array $data = [],
          DirectoryHelper $directory = null
          )
          parent::__construct(
          $context,
          $registry,
          $extensionFactory,
          $customAttributeFactory,
          $paymentData,
          $scopeConfig,
          $logger,
          $resource,
          $resourceCollection,
          $data,
          $directory
          );







          share|improve this answer

























          • not working for me

            – tge
            yesterday











          • share your code

            – Amit Bera
            yesterday











          • see my question i updated

            – tge
            yesterday











          • see my code? need help

            – tge
            yesterday






          • 1





            Answer updated and YourNameSpace & YourClass with your namespace & class repectively.

            – Amit Bera
            yesterday













          0












          0








          0







          If you extend MagentoPaymentModelMethodAbstractMethod then your __construct function should have followed below classes parameters



           MagentoFrameworkModelContext $context,
          MagentoFrameworkRegistry $registry,
          MagentoFrameworkApiExtensionAttributesFactory $extensionFactory,
          MagentoFrameworkApiAttributeValueFactory $customAttributeFactory,
          MagentoPaymentHelperData $paymentData,
          MagentoFrameworkAppConfigScopeConfigInterface $scopeConfig,
          Logger $logger,
          MagentoFrameworkModelResourceModelAbstractResource $resource = null,
          MagentoFrameworkDataCollectionAbstractDb $resourceCollection = null,
          array $data = [],
          DirectoryHelper $directory = null


          So, your __construct have minimum below code



           <?php

          namespace YourNameSpace;

          use MagentoDirectoryHelperData as DirectoryHelper;
          use CryozonicStripePaymentsHelperLogger;

          class YourClass extends MagentoPaymentModelMethodAbstractMethod

          public function __construct(
          MagentoFrameworkModelContext $context,
          MagentoFrameworkRegistry $registry,
          MagentoFrameworkApiExtensionAttributesFactory $extensionFactory,
          MagentoFrameworkApiAttributeValueFactory $customAttributeFactory,
          MagentoPaymentHelperData $paymentData,
          MagentoFrameworkAppConfigScopeConfigInterface $scopeConfig,
          MagentoPaymentModelMethodLogger $logger,
          MagentoFrameworkModelResourceModelAbstractResource $resource = null,
          MagentoFrameworkDataCollectionAbstractDb $resourceCollection = null,
          array $data = [],
          DirectoryHelper $directory = null
          )
          parent::__construct(
          $context,
          $registry,
          $extensionFactory,
          $customAttributeFactory,
          $paymentData,
          $scopeConfig,
          $logger,
          $resource,
          $resourceCollection,
          $data,
          $directory
          );







          share|improve this answer















          If you extend MagentoPaymentModelMethodAbstractMethod then your __construct function should have followed below classes parameters



           MagentoFrameworkModelContext $context,
          MagentoFrameworkRegistry $registry,
          MagentoFrameworkApiExtensionAttributesFactory $extensionFactory,
          MagentoFrameworkApiAttributeValueFactory $customAttributeFactory,
          MagentoPaymentHelperData $paymentData,
          MagentoFrameworkAppConfigScopeConfigInterface $scopeConfig,
          Logger $logger,
          MagentoFrameworkModelResourceModelAbstractResource $resource = null,
          MagentoFrameworkDataCollectionAbstractDb $resourceCollection = null,
          array $data = [],
          DirectoryHelper $directory = null


          So, your __construct have minimum below code



           <?php

          namespace YourNameSpace;

          use MagentoDirectoryHelperData as DirectoryHelper;
          use CryozonicStripePaymentsHelperLogger;

          class YourClass extends MagentoPaymentModelMethodAbstractMethod

          public function __construct(
          MagentoFrameworkModelContext $context,
          MagentoFrameworkRegistry $registry,
          MagentoFrameworkApiExtensionAttributesFactory $extensionFactory,
          MagentoFrameworkApiAttributeValueFactory $customAttributeFactory,
          MagentoPaymentHelperData $paymentData,
          MagentoFrameworkAppConfigScopeConfigInterface $scopeConfig,
          MagentoPaymentModelMethodLogger $logger,
          MagentoFrameworkModelResourceModelAbstractResource $resource = null,
          MagentoFrameworkDataCollectionAbstractDb $resourceCollection = null,
          array $data = [],
          DirectoryHelper $directory = null
          )
          parent::__construct(
          $context,
          $registry,
          $extensionFactory,
          $customAttributeFactory,
          $paymentData,
          $scopeConfig,
          $logger,
          $resource,
          $resourceCollection,
          $data,
          $directory
          );








          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited yesterday

























          answered yesterday









          Amit BeraAmit Bera

          60k1677178




          60k1677178












          • not working for me

            – tge
            yesterday











          • share your code

            – Amit Bera
            yesterday











          • see my question i updated

            – tge
            yesterday











          • see my code? need help

            – tge
            yesterday






          • 1





            Answer updated and YourNameSpace & YourClass with your namespace & class repectively.

            – Amit Bera
            yesterday

















          • not working for me

            – tge
            yesterday











          • share your code

            – Amit Bera
            yesterday











          • see my question i updated

            – tge
            yesterday











          • see my code? need help

            – tge
            yesterday






          • 1





            Answer updated and YourNameSpace & YourClass with your namespace & class repectively.

            – Amit Bera
            yesterday
















          not working for me

          – tge
          yesterday





          not working for me

          – tge
          yesterday













          share your code

          – Amit Bera
          yesterday





          share your code

          – Amit Bera
          yesterday













          see my question i updated

          – tge
          yesterday





          see my question i updated

          – tge
          yesterday













          see my code? need help

          – tge
          yesterday





          see my code? need help

          – tge
          yesterday




          1




          1





          Answer updated and YourNameSpace & YourClass with your namespace & class repectively.

          – Amit Bera
          yesterday





          Answer updated and YourNameSpace & YourClass with your namespace & class repectively.

          – Amit Bera
          yesterday

















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Magento Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f269957%2fcreate-construct-function-magento2%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

          Circuit construction for execution of conditional statements using least significant bitHow are two different registers being used as “control”?How exactly is the stated composite state of the two registers being produced using the $R_zz$ controlled rotations?Efficiently performing controlled rotations in HHLWould this quantum algorithm implementation work?How to prepare a superposed states of odd integers from $1$ to $sqrtN$?Why is this implementation of the order finding algorithm not working?Circuit construction for Hamiltonian simulationHow can I invert the least significant bit of a certain term of a superposed state?Implementing an oracleImplementing a controlled sum operation

          Magento 2 “No Payment Methods” in Admin New OrderHow to integrate Paypal Express Checkout with the Magento APIMagento 1.5 - Sales > Order > edit order and shipping methods disappearAuto Invoice Check/Money Order Payment methodAdd more simple payment methods?Shipping methods not showingWhat should I do to change payment methods if changing the configuration has no effects?1.9 - No Payment Methods showing upMy Payment Methods not Showing for downloadable/virtual product when checkout?Magento2 API to access internal payment methodHow to call an existing payment methods in the registration form?