{"id":1287,"date":"2022-08-30T15:15:16","date_gmt":"2022-08-30T15:15:16","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2013\/11\/10\/zf2-get-was-unable-to-fetch-or-create-an-instance-for-getalbumtable-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:15:16","modified_gmt":"2022-08-30T15:15:16","slug":"zf2-get-was-unable-to-fetch-or-create-an-instance-for-getalbumtable-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/zf2-get-was-unable-to-fetch-or-create-an-instance-for-getalbumtable-collection-of-common-programming-errors\/","title":{"rendered":"ZF2 &#8211; get was unable to fetch or create an instance for getAlbumTable-Collection of common programming errors"},"content":{"rendered":"<p>I used the getAlbumTable in the title since the problem I&#8217;m facing is based on the Zend Album Tutorial, might be easier for others having a similar problem to find. All I&#8217;ve done is rename Album to &#8220;Champrallies&#8221;.<\/p>\n<p>My error:<\/p>\n<pre><code>Zend\\Mvc\\Controller\\PluginManager::get was unable to fetch or create an instance for getChampralliesTable\n<\/code><\/pre>\n<p>What I&#8217;m trying to do is execute a function from a second Model I&#8217;ve created. I can execute from the &#8216;original&#8217; model no problem AlbumTable or in my case ChampionshipTable. I&#8217;m trying to get data from a second table, but within the same module. The second table is called &#8220;champ_rallies&#8221; and the Model files are Champrallies.php and ChampralliesTable.php.<\/p>\n<p>Changing this part in my controller<\/p>\n<pre><code>'champRallies' =&gt; $this-&gt;getChampralliesTable()-&gt;fetchAll(),\n<\/code><\/pre>\n<p>to<\/p>\n<pre><code>'champRallies' =&gt; $this-&gt;getChampionshipTable()-&gt;fetchAll(),\n<\/code><\/pre>\n<p>means the error message disappears. So my first thought is that there is something wrong with namespaces, or module.php. (Forgive me, I&#8217;m fairly new at all this)<\/p>\n<p>Module.php<\/p>\n<p id=\"rop\"><small>Originally posted 2013-11-10 00:14:26. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>I used the getAlbumTable in the title since the problem I&#8217;m facing is based on the Zend Album Tutorial, might be easier for others having a similar problem to find. All I&#8217;ve done is rename Album to &#8220;Champrallies&#8221;. My error: Zend\\Mvc\\Controller\\PluginManager::get was unable to fetch or create an instance for getChampralliesTable What I&#8217;m trying to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1287","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1287","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=1287"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1287\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=1287"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=1287"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=1287"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}