support for Many to Many Relationships

This commit is contained in:
nibsirahsieu 2011-09-28 18:42:08 +07:00
parent 7fb0de3574
commit 3af3fb4cf8

View file

@ -33,6 +33,13 @@ class PropelTypeGuesser implements FormTypeGuesserInterface
'multiple' => \RelationMap::MANY_TO_ONE === $relation->getType() ? false : true,
), Guess::HIGH_CONFIDENCE);
}
} elseif ($relation->getType() == \RelationMap::MANY_TO_MANY) {
if (strtolower($property) == strtolower($relation->getPluralName())) {
return new TypeGuess('model', array(
'class' => $relation->getLocalTable()->getClassName(),
'multiple' => true,
), Guess::HIGH_CONFIDENCE);
}
}
}