Exemple #1
0
 /**
  * This method sets the configuration for a 1:n relation based on
  * the $TCA column configuration
  *
  * @param string|ColumnMap $columnMap The column map
  * @param string $columnConfiguration The column configuration from $TCA
  * @return ColumnMap
  */
 protected function setOneToManyRelation(ColumnMap $columnMap, $columnConfiguration)
 {
     $columnMap->setTypeOfRelation(ColumnMap::RELATION_HAS_MANY);
     $columnMap->setChildTableName($columnConfiguration['foreign_table']);
     $columnMap->setChildTableWhereStatement($columnConfiguration['foreign_table_where']);
     $columnMap->setChildSortByFieldName($columnConfiguration['foreign_sortby']);
     $columnMap->setParentKeyFieldName($columnConfiguration['foreign_field']);
     $columnMap->setParentTableFieldName($columnConfiguration['foreign_table_field']);
     if (is_array($columnConfiguration['foreign_match_fields'])) {
         $columnMap->setRelationTableMatchFields($columnConfiguration['foreign_match_fields']);
     }
     return $columnMap;
 }