Commit 64c43a3a by Klimov Paul

Type cast added to `yii\sphinx\ActiveRecord::populateRecord()`

parent 3c5b98f7
......@@ -618,8 +618,13 @@ abstract class ActiveRecord extends BaseActiveRecord
{
$columns = static::getIndexSchema()->columns;
foreach ($row as $name => $value) {
if (isset($columns[$name]) && $columns[$name]->isMva) {
$row[$name] = explode(',', $value);
if (isset($columns[$name])) {
if ($columns[$name]->isMva) {
$mvaValue = explode(',', $value);
$row[$name] = array_map(array($columns[$name], 'typecast'), $mvaValue);
} else {
$row[$name] = $columns[$name]->typecast($value);
}
}
}
parent::populateRecord($record, $row);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment