lib/StripeObject.php
public function updateAttributes($values, $opts = null, $dirty = true)
    {
        foreach ($values as $k => $v) {
            // Special-case metadata to always be cast as a StripeObject
            // This is necessary in case metadata is empty, as PHP arrays do
            // not differentiate between lists and hashes, and we consider
            // empty arrays to be lists.
            if (($k === "metadata") && (is_array($v))) {
                $this->_values[$k] = StripeObject::constructFrom($v, $opts);
            } else {
                $this->_values[$k] = Util\Util::convertToStripeObject($v, $opts);
            }
            if ($dirty) {
                $this->dirtyValue($this->_values[$k]);
            }
            $this->_unsavedValues->add($k);
        }
    }
public function updateAttributes($values, $opts = null, $dirty = true)
    {
        foreach ($values as $k => $v) {
            // Special-case metadata to always be cast as a StripeObject
            // This is necessary in case metadata is empty, as PHP arrays do
            // not differentiate between lists and hashes, and we consider
            // empty arrays to be lists.
            if (($k === "metadata") && (is_array($v))) {
                $this->_values[$k] = StripeObject::constructFrom($v, $opts);
            } else {
                $this->_values[$k] = Util\Util::convertToStripeObject($v, $opts);
            }
            if ($dirty) {
                $this->dirtyValue($this->_values[$k]);
            }
            $this->_unsavedValues->add($k);
        }
    }
public function updateAttributes ( $ values , $ opts = null , $ dirty = true ) { foreach ( $ values as $ k => $ v ) { // Special-case metadata to always be cast as a StripeObject // This is necessary in case metadata is empty, as PHP arrays do // not differentiate between lists and hashes, and we consider // empty arrays to be lists. if ( ( $ k === "metadata" ) && ( is_array ( $ v ) ) ) { $ this -> _values [ $ k ] = StripeObject :: constructFrom ( $ v , $ opts ) ; } else { $ this -> _values [ $ k ] = Util \ Util :: convertToStripeObject ( $ v , $ opts ) ; } if ( $ dirty ) { $ this -> dirtyValue ( $ this -> _values [ $ k ] ) ; } $ this -> _unsavedValues -> add ( $ k ) ; } }
Mass assigns attributes on the model.

@param array $values
@param null|string|array|Util\RequestOptions $opts
@param boolean $dirty Defaults to true.
Mass assigns attributes on the model .