original_string: public function fillObject( $comment, $fieldNames = null )
      {
          $filledFields = $this->fields;
          if ( !is_null( $fieldNames ) && is_array( $fieldNames ) )
          {
              $filledFields = array();
              foreach ( $fieldNames as $fieldName )
              {
                  $filledFields[$fieldName] = $this->fields[$fieldName];
              }
          }
          foreach ( $filledFields as $field => $fieldSetup )
          {
              $attributeName = $fieldSetup[self::ATTRIBUTENAME];
              if ( !is_null( $attributeName ) )
              {
                  $fieldValue = $this->fieldValues[$field];
                  $comment->setAttribute( $attributeName, $fieldValue );
              }
          }
      }
code: public function fillObject( $comment, $fieldNames = null )
      {
          $filledFields = $this->fields;
          if ( !is_null( $fieldNames ) && is_array( $fieldNames ) )
          {
              $filledFields = array();
              foreach ( $fieldNames as $fieldName )
              {
                  $filledFields[$fieldName] = $this->fields[$fieldName];
              }
          }
          foreach ( $filledFields as $field => $fieldSetup )
          {
              $attributeName = $fieldSetup[self::ATTRIBUTENAME];
              if ( !is_null( $attributeName ) )
              {
                  $fieldValue = $this->fieldValues[$field];
                  $comment->setAttribute( $attributeName, $fieldValue );
              }
          }
      }
code_tokens: public function fillObject ( $ comment , $ fieldNames = null ) { $ filledFields = $ this -> fields ; if ( ! is_null ( $ fieldNames ) && is_array ( $ fieldNames ) ) { $ filledFields = array ( ) ; foreach ( $ fieldNames as $ fieldName ) { $ filledFields [ $ fieldName ] = $ this -> fields [ $ fieldName ] ; } } foreach ( $ filledFields as $ field => $ fieldSetup ) { $ attributeName = $ fieldSetup [ self :: ATTRIBUTENAME ] ; if ( ! is_null ( $ attributeName ) ) { $ fieldValue = $ this -> fieldValues [ $ field ] ; $ comment -> setAttribute ( $ attributeName , $ fieldValue ) ; } } }
docstring: Fill field to comment object
  @param $comment ezcomcomment persistent object
  @param $fieldNames field name array selected to be filled into comment
  @return
docstring_tokens: Fill field to comment object