Skip to content

Commit

Permalink
PATCH: typo
Browse files Browse the repository at this point in the history
  • Loading branch information
thiemen committed Jul 14, 2019
1 parent 3fc2ee0 commit 9edde1a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions code/Model/SalesforceDefaultContactField.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,17 @@ public function getTitle()
public function requireDefaultRecords()
{
foreach ($this->Config()->get('default_records') as $key => $details) {
$value = isset($details['Value']) ? $details['Value'] : 'please set';
$type = isset($details['ValueType']) ? $details['ValueType'] : 'String';
$filter = [
'Key' => $key,
];

$obj = self::get()->filter($filter)->first();
if (! $obj) {
$obj = self::create($filter);
// get values
$value = isset($details['Value']) ? $details['Value'] : 'please set';
$type = isset($details['ValueType']) ? $details['ValueType'] : 'String';
// set values
$obj->Value = $value;
$obj->ValueType = $type;
$obj->write();
Expand Down

0 comments on commit 9edde1a

Please sign in to comment.