[TYPO3-mvc] Query PropertyValue and selectorName (core devs?)

Tim Schoch | GSTALTIG tim.schoch at gstaltig.ch
Tue May 24 15:52:31 CEST 2011


Hello

I'm trying to find a way to have joins up and running in a current project. First thing I found was this snippet (no idea where it's from) http://pastebin.com/9xPS3Emk. It shows how to use the QOM Factory to creae a join. 
So far it works fine, but I have contraints on both sides of the join and this fails because within the Typo3DbBackend the tableName of the passed Property isn't respected. Instead, it gets it from the first join source with no way to specify which selector is required:

if ($source instanceof Tx_Extbase_Persistence_QOM_SelectorInterface) { 
  // FIXME Only necessary to differ from  Join
  $className = $source->getNodeTypeName();
  $tableName = $this->dataMapper->convertClassNameToTableName($className);
  while (strpos($propertyName, '.') !== FALSE) {
    $this->addUnionStatement($className, $tableName, $propertyName, $sql);
  }
} elseif ($source instanceof Tx_Extbase_Persistence_QOM_JoinInterface) {
  $tableName = $source->getJoinCondition()->getSelector1Name();
}

@see Tx_Extbase_Persistence_Storage_Typo3DbBackend::parseDynamicOperand()

Why is $operand['selectorName'] ignored by default? Is it expected to be wrong by default? Would a simple «if not empty $operand['selectorName'] use $operand['selectorName'] else get from join» introduce any side effects I can't see at the moment?
(@author is missing, so I post this as an open question to who ever knows)

My setup: http://pastebin.com/kRygY4rz

Thanks
Tim


More information about the TYPO3-project-typo3v4mvc mailing list