Skip to content
Permalink
Browse files

Remove casting of constraints, this is done on doctrine level anyways…

…, and prevents using IN constraints
  • Loading branch information...
flack committed Mar 22, 2019
1 parent 892b1bf commit e2e7913c850076bbacbb380b1a26e19005ccb382
Showing with 0 additions and 15 deletions.
  1. +0 −15 src/midcom/datamanager/helper/autocomplete.php
@@ -86,9 +86,6 @@ private function prepare_qb()
private function apply_constraints(midcom_core_query $query, array $constraints)
{
$mgdschema_class = midcom_helper_reflector::resolve_baseclass($query->get_classname());
$reflector = new midgard_reflection_property($mgdschema_class);
ksort($constraints);
foreach ($constraints as $key => $data) {
if ( !array_key_exists('value', $data)
@@ -100,18 +97,6 @@ private function apply_constraints(midcom_core_query $query, array $constraints)
if ($data['field'] === 'username') {
midcom_core_account::add_username_constraint($query, $data['op'], $data['value']);
} else {
switch ($reflector->get_midgard_type($data['field'])) {
case MGD_TYPE_INT:
case MGD_TYPE_UINT:
$data['value'] = (int) $data['value'];
break;
case MGD_TYPE_FLOAT:
$data['value'] = (float) $data['value'];
break;
case MGD_TYPE_BOOLEAN:
$data['value'] = (boolean) $data['value'];
break;
}
$query->add_constraint($data['field'], $data['op'], $data['value']);
}
}

0 comments on commit e2e7913

Please sign in to comment.
You can’t perform that action at this time.