Skip to content

Commit

Permalink
Fix update function in active record
Browse files Browse the repository at this point in the history
  • Loading branch information
Christopher Mota committed Apr 19, 2017
1 parent ad28388 commit bce1be1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ActiveRecord.php
Expand Up @@ -205,9 +205,9 @@ protected function updateInternal($attributes = null)
} else if($value === ''){
$attributes[] = ['attrib' => $key, 'modtype' => LDAP_MODIFY_BATCH_REMOVE];
} else if (empty ($this->getOldAttribute($key))) {
$attributes[] = ['attrib' => $key, 'modtype' => LDAP_MODIFY_BATCH_ADD, 'values' => [$value]];
$attributes[] = ['attrib' => $key, 'modtype' => LDAP_MODIFY_BATCH_ADD, 'values' => is_array($value) ? $value : [$value]];
} else {
$attributes[] = ['attrib' => $key, 'modtype' => LDAP_MODIFY_BATCH_REPLACE, 'values' => [$value]];
$attributes[] = ['attrib' => $key, 'modtype' => LDAP_MODIFY_BATCH_REPLACE, 'values' => is_array($value) ? $value : [$value]];
}
}

Expand Down

0 comments on commit bce1be1

Please sign in to comment.