Ejemplo n.º 1
0
 /**
  * Builds and returns the source to build a join for a m:n relation.
  *
  * @param DomainObjectInterface $parentObject
  * @param string $propertyName
  * @return \TYPO3\CMS\Extbase\Persistence\Generic\Qom\SourceInterface $source
  */
 protected function getSource(DomainObjectInterface $parentObject, $propertyName)
 {
     $columnMap = $this->getDataMap(get_class($parentObject))->getColumnMap($propertyName);
     $left = $this->qomFactory->selector(null, $columnMap->getRelationTableName());
     $childClassName = $this->getType(get_class($parentObject), $propertyName);
     $right = $this->qomFactory->selector($childClassName, $columnMap->getChildTableName());
     $joinCondition = $this->qomFactory->equiJoinCondition($columnMap->getRelationTableName(), $columnMap->getChildKeyFieldName(), $columnMap->getChildTableName(), 'uid');
     $source = $this->qomFactory->join($left, $right, Persistence\Generic\Query::JCR_JOIN_TYPE_INNER, $joinCondition);
     return $source;
 }