[TYPO3-mvc] fetching data from pages table

Jochen Rau jochen.rau at typoplanet.de
Fri Feb 19 16:28:04 CET 2010


Hi Alex.

On 19.02.10 15:48, Alex Bailey wrote:
> Im currently working on a extension where I have to fetch the fields of
> my Pages table, I already mapped the table to match my extension by using
>
> config.tx_extbase.persistence.classes{
> Tx_T3wVvsTags_Domain_Model_Page{
> mapping{
> tableName = pages
> }
> }
> }
>
> But for some particular reason a findAll() query on my table only
> returns the pages with Pid 0 and not all of them (unique uid) as it should.
> Is there something I'm missing about using this table?

The reason for this behavior is the slightly different semantic of pid 
in the pages table compared to the other tables. It means "parent page 
uid" (in comparison to "is on page with uid").

I assume that you haven't defined any storage pid (dafault is 0). So, 
Extbase "thinks" that it has to query for pages "on page" 0.

Solution: follow Steffens tip and set 
$querySettings->setRespectStoragePage(FALSE);

Additionally you can define a mapping like:

config.tx_extbase {
  persistence{
   classes {
    Tx_Voila_Domain_Model_Structure_PageNode {
     mapping {
       tableName = pages
       columns {
        pid.mapOnProperty = parentNodeIdentifier
       }
      }
     }
    }
   }
  }
}

Regards
Jochen

P.S. EXT:voila is my locally running replacement fore TemplaVoila ;-)



More information about the TYPO3-project-typo3v4mvc mailing list