converted tabs to spaces as per psr-2

This commit is contained in:
Myles Beardsmore 2016-02-04 16:07:15 +13:00
parent 76c10d8df2
commit 65f6d7531b
1 changed files with 20 additions and 20 deletions

View File

@ -231,7 +231,7 @@ class TagField extends DropdownField
}
return $options;
}
}
/**
* {@inheritdoc}
@ -310,7 +310,7 @@ class TagField extends DropdownField
$relation->setByIDList(array_filter($ids));
}
}
/**
* Get or create tag with the given value
@ -321,25 +321,25 @@ class TagField extends DropdownField
protected function getOrCreateTag($term)
{
// Check if existing record can be found
$source = $this->getSource();
$titleField = $this->getTitleField();
$record = $source
->filter($titleField, $term)
->first();
if($record) {
return $record;
}
$source = $this->getSource();
$titleField = $this->getTitleField();
$record = $source
->filter($titleField, $term)
->first();
if($record) {
return $record;
}
// Create new instance if not yet saved
if ($this->getCanCreate()) {
$dataClass = $source->dataClass();
$record = Injector::inst()->create($dataClass);
$record->{$titleField} = $term;
$record->write();
return $record;
} else {
return false;
}
// Create new instance if not yet saved
if ($this->getCanCreate()) {
$dataClass = $source->dataClass();
$record = Injector::inst()->create($dataClass);
$record->{$titleField} = $term;
$record->write();
return $record;
} else {
return false;
}
}
/**