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

                      Grendel Contents Story Scholarship Depictions Notes References Navigation menu10.1093/notesj/gjn112Berserkeree

                      Log in Navigation menu

                      Invalid response line returned from server: HTTP/2 401 | ErrorPlease Please Help With Error 500 Internal Server Error after upgrading from 1.7 to 1.9Unable to place new customer orders in admin backendMagento - For “Manage Categories” Forbidden You do not have permission to access this documentHTTP ERROR 500 when using require(_once) app/Mage.phpMemcached causing Web Setup Wizard ErrorCould not create an acl object: Invalid XMLAn error occurred on the server. Please try to place the order againInvalid response line returned from server: HTTP/2 200 - message after update to 2.1.7Magento-CE 2.3.0 installation error on XamppMagento 2.2.6- After Migration all default Payment Methods are not working fine