original_string: private function appendChangeSet(Model $model, array $obj, Closure $handler)
      {
          $metadata = $model->getMetadata();
          $changeset = $model->getChangeSet();
          $formatter = $this->getFormatter();
  
          foreach ($this->changeSetMethods as $setKey => $methods) {
              list($metaMethod, $formatMethod) = $methods;
              foreach ($changeset[$setKey] as $key => $values) {
                  $value = $formatter->$formatMethod($metadata->$metaMethod($key), $values['new']);
                  $obj = $handler($key, $value, $obj);
              }
          }
          return $obj;
      }
code: private function appendChangeSet(Model $model, array $obj, Closure $handler)
      {
          $metadata = $model->getMetadata();
          $changeset = $model->getChangeSet();
          $formatter = $this->getFormatter();
  
          foreach ($this->changeSetMethods as $setKey => $methods) {
              list($metaMethod, $formatMethod) = $methods;
              foreach ($changeset[$setKey] as $key => $values) {
                  $value = $formatter->$formatMethod($metadata->$metaMethod($key), $values['new']);
                  $obj = $handler($key, $value, $obj);
              }
          }
          return $obj;
      }
code_tokens: private function appendChangeSet ( Model $ model , array $ obj , Closure $ handler ) { $ metadata = $ model -> getMetadata ( ) ; $ changeset = $ model -> getChangeSet ( ) ; $ formatter = $ this -> getFormatter ( ) ; foreach ( $ this -> changeSetMethods as $ setKey => $ methods ) { list ( $ metaMethod , $ formatMethod ) = $ methods ; foreach ( $ changeset [ $ setKey ] as $ key => $ values ) { $ value = $ formatter -> $ formatMethod ( $ metadata -> $ metaMethod ( $ key ) , $ values [ 'new' ] ) ; $ obj = $ handler ( $ key , $ value , $ obj ) ; } } return $ obj ; }
docstring: Appends the change set values to a database object based on the provided handler.
  
  @param   Model   $model
  @param   array   $obj
  @param   Closure $handler
  @return  array
docstring_tokens: Appends the change set values to a database object based on the provided handler .