예제 #1
0
 /**
  * Gets the node-tuple source for this query.
  *
  * @return Tx_Extbase_Persistence_QOM_SourceInterface the node-tuple source; non-null
  */
 public function getSource()
 {
     if ($this->source === NULL) {
         $this->source = $this->qomFactory->selector($this->getType(), $this->dataMapper->convertClassNameToTableName($this->getType()));
     }
     return $this->source;
 }
예제 #2
0
 /**
  * Builds and returns the source to build a join for a m:n relation.
  *
  * @param Tx_Extbase_DomainObject_DomainObjectInterface $parentObject
  * @param string $propertyName
  * @return Tx_Extbase_Persistence_QOM_SourceInterface $source
  */
 protected function getSource(Tx_Extbase_DomainObject_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, Tx_Extbase_Persistence_QueryInterface::JCR_JOIN_TYPE_INNER, $joinCondition);
     return $source;
 }