fix php 5.6 in docker dev env (#1740)
[openemr.git] / vendor / stripe / stripe-php / lib / AttachedObject.php
blob6a8951788edbb44e0ff0db3263e2bc3b85035f9a
1 <?php
3 namespace Stripe;
5 use Countable;
7 /**
8 * Class AttachedObject
10 * e.g. metadata on Stripe objects.
12 * @package Stripe
14 class AttachedObject extends StripeObject implements Countable
16 /**
17 * Updates this object.
19 * @param array $properties A mapping of properties to update on this object.
21 public function replaceWith($properties)
23 $removed = array_diff(array_keys($this->_values), array_keys($properties));
24 // Don't unset, but rather set to null so we send up '' for deletion.
25 foreach ($removed as $k) {
26 $this->$k = null;
29 foreach ($properties as $k => $v) {
30 $this->$k = $v;
34 /**
35 * Counts the number of elements in the AttachedObject instance.
37 * @return int the number of elements
39 public function count()
41 return count($this->_values);