Skip to content
This repository has been archived by the owner on Jan 12, 2022. It is now read-only.

Commit

Permalink
fix for PHP 7
Browse files Browse the repository at this point in the history
  • Loading branch information
himiklab committed Feb 2, 2016
1 parent 25528b0 commit 9a053fb
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Search.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,10 +186,13 @@ protected function createDocument($fields)
{
$document = new Document();
foreach ($fields as $field) {
if (!isset($field['type'])) {
$field['type'] = behaviors\SearchBehavior::FIELD_TEXT;
if (isset($field['type'])) {
$currentType = $field['type'];
} else {
$currentType = behaviors\SearchBehavior::FIELD_TEXT;
}
$document->addField(Field::$field['type'](

$document->addField(Field::$currentType(
$field['name'],
$field['value']
));
Expand Down

0 comments on commit 9a053fb

Please sign in to comment.