[ Index ]

PHP Cross Reference of Phabricator

title

Body

[close]

/externals/stripe-php/lib/Stripe/ -> AttachedObject.php (source)

   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  }


Generated: Sun Nov 30 09:20:46 2014 Cross-referenced by PHPXref 0.7.1