<commit_before><?php

/**
 * @file
 * Contains DoSomethingCampaignsResource.
 */
class DoSomethingCampaignsResource extends RestfulEntityBaseNode {

  /**
   * Overrides RestfulEntityBaseNode::publicFieldsInfo().
   */
  public function publicFieldsInfo() {
    $public_fields = parent::publicFieldsInfo();

    $public_fields['type'] = array(
      'property' => 'field_campaign_type',
    );

    $public_fields['status'] = array(
      'property' => 'field_campaign_status',
    );

    $public_fields['call_to_action'] = array(
      'property' => 'field_call_to_action',
    );
    // This is so wtf.
    // If I name it as 'cover_image' it doesn't work.
    // If I name it as just 'image' it works.
    $public_fields['image'] = array(
      'property' => 'field_image_campaign_cover',
       'resource' => array(
          'image' => 'assets',
        ),
    );

    $public_fields['primary_cause'] = array(
      'property' => 'field_primary_cause',
       'resource' => array(
          'primary_cause' => 'terms',
        ),
    );

    $public_fields['cause'] = array(
      'property' => 'field_cause',
       'resource' => array(
          'cause' => 'terms',
        ),
    );
    $public_fields['issue'] = array(
      'property' => 'field_issue',
       'resource' => array(
          'issue' => 'terms',
        ),
    );
    $public_fields['tags'] = array(
      'property' => 'field_tags',
       'resource' => array(
          'tags' => 'terms',
        ),
    );

    $public_fields['call_to_action'] = array(
      'property' => 'field_call_to_action',
    );

    $public_fields['faq'] = array(
      'property' => 'field_faq',
    );
    return $public_fields;
  }
}
<commit_msg>Adds cause and action_type, adds todo for non working single value fields<commit_after><?php

/**
 * @file
 * Contains DoSomethingCampaignsResource.
 */
class DoSomethingCampaignsResource extends RestfulEntityBaseNode {

  /**
   * Overrides RestfulEntityBaseNode::publicFieldsInfo().
   */
  public function publicFieldsInfo() {
    $public_fields = parent::publicFieldsInfo();

    $public_fields['type'] = array(
      'property' => 'field_campaign_type',
    );

    $public_fields['status'] = array(
      'property' => 'field_campaign_status',
    );

    $public_fields['call_to_action'] = array(
      'property' => 'field_call_to_action',
    );
    // This is so wtf.
    // If I name it as 'cover_image' it doesn't work.
    // If I name it as just 'image' it works.
    $public_fields['image'] = array(
      'property' => 'field_image_campaign_cover',
       'resource' => array(
          'image' => 'assets',
        ),
    );

    //@todo This isn't working! Returns NULL.
    $public_fields['primary_cause'] = array(
      'property' => 'field_primary_cause',
       'resource' => array(
          'primary_cause' => 'terms',
        ),
    );

    $public_fields['cause'] = array(
      'property' => 'field_cause',
       'resource' => array(
          'cause' => 'terms',
        ),
    );

    // @todo This doesn't work either.
    // It's not liking something about the single value taxonomy :(
    $public_fields['primary_action_type'] = array(
      'property' => 'field_primary_action_type',
       'resource' => array(
          'primary_action_type' => 'terms',
        ),
    );

    $public_fields['action_type'] = array(
      'property' => 'field_action_type',
       'resource' => array(
          'action_type' => 'terms',
        ),
    );

    $public_fields['cause'] = array(
      'property' => 'field_cause',
       'resource' => array(
          'cause' => 'terms',
        ),
    );

    $public_fields['issue'] = array(
      'property' => 'field_issue',
       'resource' => array(
          'issue' => 'terms',
        ),
    );
    $public_fields['tags'] = array(
      'property' => 'field_tags',
       'resource' => array(
          'tags' => 'terms',
        ),
    );

    $public_fields['call_to_action'] = array(
      'property' => 'field_call_to_action',
    );

    $public_fields['faq'] = array(
      'property' => 'field_faq',
    );
    return $public_fields;
  }
}

{'fraction_non_alphanumeric': 0.16347783967062243, 'fraction_numerical': 0.0, 'mean_word_length': 2.488175675675676, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 52, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3962690', 'n_tokens_mistral': 1342, 'n_tokens_neox': 1286, 'n_words': 253}