Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/externals/stripe-php/lib/Stripe/AttachedObject.php
12256 views
1
<?php
2
3
// e.g. metadata on Stripe objects.
4
class Stripe_AttachedObject extends Stripe_Object
5
{
6
/**
7
* Updates this object.
8
*
9
* @param array $properties A mapping of properties to update on this object.
10
*/
11
public function replaceWith($properties)
12
{
13
$removed = array_diff(array_keys($this->_values), array_keys($properties));
14
// Don't unset, but rather set to null so we send up '' for deletion.
15
foreach ($removed as $k) {
16
$this->$k = null;
17
}
18
19
foreach ($properties as $k => $v) {
20
$this->$k = $v;
21
}
22
}
23
}
24
25