Skip to content

Commit 0d6c9a8

Browse files
author
Mirza Selimovic
committed
fixing dbType array when using propel
1 parent 33694db commit 0d6c9a8

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

Guesser/PropelORMFieldGuesser.php

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -325,15 +325,21 @@ protected function getOptions($type, $dbType, $model, $fieldPath, $filter = fals
325325
if (preg_match("#CollectionType$#i", $type)) {
326326
$relation = $this->getRelation($columnName, $class);
327327

328+
if ($relation) {
329+
return array(
330+
'allow_add' => true,
331+
'allow_delete' => true,
332+
'by_reference' => false,
333+
'entry_type' => 'entity',
334+
'entry_options' => array(
335+
'class' => \RelationMap::MANY_TO_ONE === $relation->getType() ? $relation->getForeignTable()->getClassname() : $relation->getLocalTable()->getClassname()
336+
)
337+
);
338+
}
339+
328340
return array(
329-
'allow_add' => true,
330-
'allow_delete' => true,
331-
'by_reference' => false,
332-
'entry_type' => 'entity',
333-
'entry_options' => array(
334-
'class' => \RelationMap::MANY_TO_ONE === $relation->getType() ? $relation->getForeignTable()->getClassname() : $relation->getLocalTable()->getClassname()
335-
)
336-
);
341+
'entry_type' => 'text',
342+
);
337343
}
338344

339345
if (\PropelColumnTypes::ENUM == $dbType) {

0 commit comments

Comments
 (0)