Note that there are some explanatory texts on larger screens.

plurals
  1. POMapping to "pages" table from Extbase in TYPO3 6.1
    primarykey
    data
    text
    <p>I created an extension with a domain model <code>Message</code>. This model has a relation m:n with the TYPO3 <code>pages</code> (the one which has the details of the pages, like title, issite_root etc) table. However, by using the <code>mapping to existing tables</code> option, it gives me <code>type</code> error saying page : </p> <pre><code>The configured type field for table "pages" is of type int(11) unsigned This means the type field can not be used for defining the record type. You have to configure the mappings yourself if you want to map to this table or extend the correlated class </code></pre> <p>So I just create the relation without mapping, so that I can later map it from <code>setup.txt</code>. </p> <p><img src="https://i.stack.imgur.com/evYkz.png" alt="enter image description here"></p> <p>The I created model <code>Pages</code> in <code>MyExt/Classes/Domain/Model/</code> with all the getters/setters and repository in <code>MyExt/Classes/Domain/Repository/</code>.</p> <p>In my setup.txt I did this:</p> <pre><code>config.tx_extbase {     persistence{         enableAutomaticCacheClearing = 1         updateReferenceIndex = 0         classes {         Tx_Playfield_Domain_Model_Pages {             mapping {                     tableName = pages                 columns {                                 uid.mapOnProperty               = uid                                 pid.mapOnProperty               = pid                                 sorting.mapOnProperty           = sorting                                 title.mapOnProperty             = title                                 subtitle.mapOnProperty          = subtitle                             }                 }             }       }     } } </code></pre> <p>But when I try to access the Pages model I created, </p> <p><code>var_dump($this-&gt;pagesRepository-&gt;findByUid(74));</code></p> <p>its searching for <code>tx_playfield_domain_model_pages</code> which does not exists, it shows</p> <pre><code>Table 'typo3.tx_playfield_domain_model_pages' doesn't exist: SELECT tx_playfield_domain_model_pages.* FROM tx_playfield_domain_model_pages WHERE tx_playfield_domain_model_pages.uid = '74' LIMIT 1 </code></pre> <p>What am I missing here?</p> <p><strong>Update</strong></p> <p>After following <a href="http://t3-developer.com/extbase-fluid/cheats-extbase/model/tabelle-pages-in-extbase/" rel="nofollow noreferrer">http://t3-developer.com/extbase-fluid/cheats-extbase/model/tabelle-pages-in-extbase/</a> suggested by @Michael I get an <code>empty result</code> from <code>$this-&gt;pagesRepository-&gt;findByUid(74)</code></p> <p><code>setup.txt</code> is loading. I did this to check it: </p> <pre><code>plugin.tx_playfield{ settings{ temp=yes } } </code></pre> <p>And this is being accessed from my controller. </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload