-
Notifications
You must be signed in to change notification settings - Fork 29
Open
Description
Hi,
I think I found a bug.
I have an array type in the schema : <column name="roles" type="array" required="false" />
So I have an exception : Error: Call to a member function getType() on boolean
that occurs in PropelORMFieldGuesser.
It's because in PropelORMFieldGuesser::getOptions() the parameter $type is set to Symfony\Component\Form\Extension\Core\Type\CollectionType. And that's ok (see : here )
So I added at the beginning of the function getOptions() :
if ('virtual' === $dbType || 'ARRAY' == $dbType)
{
return array();
}
*EDIT : *
Another solution is :
At line 328 of PropelORMFieldGuesser :
if (preg_match("#CollectionType$#i", $type)) {
$relation = $this->getRelation($columnName, $class);
if ($relation) {
return array(
'allow_add' => true,
'allow_delete' => true,
'by_reference' => false,
'entry_type' => 'entity',
'entry_options' => array(
'class' => \RelationMap::MANY_TO_ONE === $relation->getType() ? $relation->getForeignTable()->getClassname() : $relation->getLocalTable()->getClassname()
)
);
}else{
return array(
'entry_type' => 'text',
);
}
}
Metadata
Metadata
Assignees
Labels
No labels