crunchbutton/include/library/Cana/Stripe/AttachedObject.php
2013-12-17 16:03:57 -02:00

18 lines
396 B
PHP
Executable File

<?php
class Stripe_AttachedObject extends Stripe_Object
{
public function replaceWith($properties)
{
$removed = array_diff(array_keys($this->_values), array_keys($properties));
// Don't unset, but rather set to null so we send up '' for deletion.
foreach ($removed as $k) {
$this->$k = null;
}
foreach ($properties as $k => $v) {
$this->$k = $v;
}
}
}