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

                      Get product attribute by attribute group code in magento 2get product attribute by product attribute group in magento 2Magento 2 Log Bundle Product Data in List Page?How to get all product attribute of a attribute group of Default attribute set?Magento 2.1 Create a filter in the product grid by new attributeMagento 2 : Get Product Attribute values By GroupMagento 2 How to get all existing values for one attributeMagento 2 get custom attribute of a single product inside a pluginMagento 2.3 How to get all the Multi Source Inventory (MSI) locations collection in custom module?Magento2: how to develop rest API to get new productsGet product attribute by attribute group code ( [attribute_group_code] ) in magento 2

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

                      Magento 2.3: How do i solve this, Not registered handle, on custom form?How can i rewrite TierPrice Block in Magento2magento 2 captcha not rendering if I override layout xmlmain.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?Magento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom OptionsMagento 2.3 : File Upload issue in UI Component FormMagento2 Not registered handleHow to configured Form Builder Js in my custom magento 2.3.0 module?Magento 2.3. How to create image upload field in an admin form