Fatal error: Cannot declare class , because the name is already in usesetup:di:compile error because of duplicated class of data-migration-toolModel Override issue in magento 2Fatal error: Cannot declare class Product, because the name is alreadyFatal error: Uncaught Error: Cannot instantiate abstract class MagentoFrameworkModelResourceModelAbstractResourceMagento2: Fatal error: Uncaught Error: Cannot instantiate interfaceMagento2 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?Overriding the contact form module gets the fatal error in Magento2.2.5?Magento 2 Fatal error when adding date field in admin form and save

I'm attempting to understand my 401k match and how much I need to contribute to maximize the match

Why did Ham the Chimp push levers?

How to explain intravenous drug abuse to a 6-year-old?

why it is 2>&1 and not 2>>&1 to append to a log file

How could a civilization detect tachyons?

How long can fsck take on a 30 TB volume?

Why doesn't a particle exert force on itself?

Creating Stored Procedure in local db that references tables in linked server

My parents are Afghan

Light Switch Neutrals: Bundle all together?

When an electron around an atom drops to a lower state, is 100% of the energy converted to a photon?

What's an appropriate age to involve kids in life changing decisions?

Why does this pattern in powers happen?

Is there a need for better software for writers?

Steganography in Latex

Why doesn't increasing the temperature of something like wood or paper set them on fire?

Can you turn music upside down?

What are these pads?

Why doesn't Dany protect her dragons better?

Are wands in any sort of book going to be too much like Harry Potter?

What are my options legally if NYC company is not paying salary?

Exactly which act of bravery are Luke and Han awarded a medal for?

Add elements inside Array conditionally in JavaScript

How to avoid making self and former employee look bad when reporting on fixing former employee's work?



Fatal error: Cannot declare class , because the name is already in use


setup:di:compile error because of duplicated class of data-migration-toolModel Override issue in magento 2Fatal error: Cannot declare class Product, because the name is alreadyFatal error: Uncaught Error: Cannot instantiate abstract class MagentoFrameworkModelResourceModelAbstractResourceMagento2: Fatal error: Uncaught Error: Cannot instantiate interfaceMagento2 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?Overriding the contact form module gets the fatal error in Magento2.2.5?Magento 2 Fatal error when adding date field in admin form and save






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








1
















Fatal error: Cannot declare class VendorModelnameResourceModelDoccount, because the name is already in use in /var/www/html/readyresale/app/code/VendorModelname/Model/ResourceModel/Doccount.php on line 23




ResourceModel/Doccount.php file



namespace VendorModulenameResourceModel;

use MagentoFrameworkModelResourceModelDbAbstractDb;

class Doccount extends AbstractDb

/**
*
*/
protected function _construct()

$this->_init ( 'documentcountable','id' );




model/Doccountmodel.php file



namespace VendorModulenameModel;

use MagentoFrameworkModelAbstractModel;

class Doccountmodel extends AbstractModel

public function _construct()

$this->_init ( 'VendorModulenameModelResourceModelDoccount' );











share|improve this question
























  • can you please add code for this file?

    – Abhishek Panchal
    Jul 3 '18 at 15:03

















1
















Fatal error: Cannot declare class VendorModelnameResourceModelDoccount, because the name is already in use in /var/www/html/readyresale/app/code/VendorModelname/Model/ResourceModel/Doccount.php on line 23




ResourceModel/Doccount.php file



namespace VendorModulenameResourceModel;

use MagentoFrameworkModelResourceModelDbAbstractDb;

class Doccount extends AbstractDb

/**
*
*/
protected function _construct()

$this->_init ( 'documentcountable','id' );




model/Doccountmodel.php file



namespace VendorModulenameModel;

use MagentoFrameworkModelAbstractModel;

class Doccountmodel extends AbstractModel

public function _construct()

$this->_init ( 'VendorModulenameModelResourceModelDoccount' );











share|improve this question
























  • can you please add code for this file?

    – Abhishek Panchal
    Jul 3 '18 at 15:03













1












1








1









Fatal error: Cannot declare class VendorModelnameResourceModelDoccount, because the name is already in use in /var/www/html/readyresale/app/code/VendorModelname/Model/ResourceModel/Doccount.php on line 23




ResourceModel/Doccount.php file



namespace VendorModulenameResourceModel;

use MagentoFrameworkModelResourceModelDbAbstractDb;

class Doccount extends AbstractDb

/**
*
*/
protected function _construct()

$this->_init ( 'documentcountable','id' );




model/Doccountmodel.php file



namespace VendorModulenameModel;

use MagentoFrameworkModelAbstractModel;

class Doccountmodel extends AbstractModel

public function _construct()

$this->_init ( 'VendorModulenameModelResourceModelDoccount' );











share|improve this question

















Fatal error: Cannot declare class VendorModelnameResourceModelDoccount, because the name is already in use in /var/www/html/readyresale/app/code/VendorModelname/Model/ResourceModel/Doccount.php on line 23




ResourceModel/Doccount.php file



namespace VendorModulenameResourceModel;

use MagentoFrameworkModelResourceModelDbAbstractDb;

class Doccount extends AbstractDb

/**
*
*/
protected function _construct()

$this->_init ( 'documentcountable','id' );




model/Doccountmodel.php file



namespace VendorModulenameModel;

use MagentoFrameworkModelAbstractModel;

class Doccountmodel extends AbstractModel

public function _construct()

$this->_init ( 'VendorModulenameModelResourceModelDoccount' );








magento2 class






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jul 4 '18 at 5:44









Dhaduk Mitesh

669218




669218










asked Jul 3 '18 at 14:58









GopinathanGopinathan

62




62












  • can you please add code for this file?

    – Abhishek Panchal
    Jul 3 '18 at 15:03

















  • can you please add code for this file?

    – Abhishek Panchal
    Jul 3 '18 at 15:03
















can you please add code for this file?

– Abhishek Panchal
Jul 3 '18 at 15:03





can you please add code for this file?

– Abhishek Panchal
Jul 3 '18 at 15:03










2 Answers
2






active

oldest

votes


















0














It's an issue with your namespace declaration



Change the code in file ResourceModel/Doccount.php file



namespace VendorModulenameResourceModel;


with



namespace VendorModulenameModelResourceModel;


Also, make sure that ResourceModel/Doccount.php inside Model directory so it'll be Model/ResourceModel/Doccount.php






share|improve this answer






























    0














    namespace VendorModulenameResourceModel;


    With



    namespace VendorModulenamemodelResourceModel;





    share|improve this answer

























      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%2f232207%2ffatal-error-cannot-declare-class-because-the-name-is-already-in-use%23new-answer', 'question_page');

      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      0














      It's an issue with your namespace declaration



      Change the code in file ResourceModel/Doccount.php file



      namespace VendorModulenameResourceModel;


      with



      namespace VendorModulenameModelResourceModel;


      Also, make sure that ResourceModel/Doccount.php inside Model directory so it'll be Model/ResourceModel/Doccount.php






      share|improve this answer



























        0














        It's an issue with your namespace declaration



        Change the code in file ResourceModel/Doccount.php file



        namespace VendorModulenameResourceModel;


        with



        namespace VendorModulenameModelResourceModel;


        Also, make sure that ResourceModel/Doccount.php inside Model directory so it'll be Model/ResourceModel/Doccount.php






        share|improve this answer

























          0












          0








          0







          It's an issue with your namespace declaration



          Change the code in file ResourceModel/Doccount.php file



          namespace VendorModulenameResourceModel;


          with



          namespace VendorModulenameModelResourceModel;


          Also, make sure that ResourceModel/Doccount.php inside Model directory so it'll be Model/ResourceModel/Doccount.php






          share|improve this answer













          It's an issue with your namespace declaration



          Change the code in file ResourceModel/Doccount.php file



          namespace VendorModulenameResourceModel;


          with



          namespace VendorModulenameModelResourceModel;


          Also, make sure that ResourceModel/Doccount.php inside Model directory so it'll be Model/ResourceModel/Doccount.php







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Jul 4 '18 at 5:02









          Evince DevelopmentEvince Development

          1,099319




          1,099319























              0














              namespace VendorModulenameResourceModel;


              With



              namespace VendorModulenamemodelResourceModel;





              share|improve this answer





























                0














                namespace VendorModulenameResourceModel;


                With



                namespace VendorModulenamemodelResourceModel;





                share|improve this answer



























                  0












                  0








                  0







                  namespace VendorModulenameResourceModel;


                  With



                  namespace VendorModulenamemodelResourceModel;





                  share|improve this answer















                  namespace VendorModulenameResourceModel;


                  With



                  namespace VendorModulenamemodelResourceModel;






                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Jul 4 '18 at 5:14









                  Chirag Patel

                  2,843424




                  2,843424










                  answered Jul 3 '18 at 15:22









                  Gopi NathanGopi Nathan

                  103




                  103



























                      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%2f232207%2ffatal-error-cannot-declare-class-because-the-name-is-already-in-use%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?