<commit_before><?php
/**
 * @see https://developers.podio.com/doc/items
 */
class PodioItem extends PodioObject {
  public function __construct($attributes = array()) {

    # Basic item
    $this->property('item_id', 'integer', array('id' => true));
    $this->property('app', 'hash');
    $this->property('external_id', 'string');
    $this->property('title', 'string');
    $this->property('link', 'string');
    $this->property('rights', 'array');

    $this->has_one('initial_revision', 'ItemRevision');
    $this->has_one('current_revision', 'ItemRevision');
    $this->has_many('fields', 'ItemField');

    # Extra properties for full item
    $this->property('ratings', 'hash');
    $this->property('user_ratings', 'hash');
    $this->property('last_event_on', 'datetime');
    $this->property('participants', 'hash');
    $this->property('tags', 'array');
    $this->property('refs', 'array');
    $this->property('references', 'array');
    $this->property('linked_account_id', 'integer');
    $this->property('subscribed', 'boolean');
    $this->property('invite', 'hash');

    $this->has_one('ref', 'Reference');
    $this->has_one('reminder', 'Reminder');
    $this->has_one('recurrence', 'Recurrence');
    $this->has_many('comments', 'Comment');
    $this->has_many('revisions', 'ItemRevision');
    $this->has_many('files', 'File', array('json_value' => 'file_id', 'json_target' => 'file_ids'));
    $this->has_many('tasks', 'Task');
    $this->has_many('shares', 'AppMarketShare');
    $this->has_many('linked_account_data', 'LinkedAccountData');

    # When getting item collection
    $this->property('comment_count', 'integer');
    $this->property('task_count', 'integer');

    $this->init($attributes);
  }

  /**
   * @see https://developers.podio.com/doc/items/get-item-22360
   */
  public static function get($item_id, $attributes = array()) {
    return self::member(Podio::get("/item/{$item_id}", $attributes));
  }

  /**
   * @see https://developers.podio.com/doc/items/get-item-basic-61768
   */
  public static function get_basic($item_id, $attributes = array()) {
    return self::member(Podio::get("/item/{$item_id}/basic", $attributes));
  }

  /**
   * @see https://developers.podio.com/doc/items/filter-items-4496747
   */
  public static function filter($app_id, $attributes = array()) {
    return self::collection(Podio::post("/item/app/{$app_id}/filter/", $attributes));
  }

  /**
   * @see https://developers.podio.com/doc/items/filter-items-by-view-4540284<commit_msg>Add get item by external id method<commit_after><?php
/**
 * @see https://developers.podio.com/doc/items
 */
class PodioItem extends PodioObject {
  public function __construct($attributes = array()) {

    # Basic item
    $this->property('item_id', 'integer', array('id' => true));
    $this->property('app', 'hash');
    $this->property('external_id', 'string');
    $this->property('title', 'string');
    $this->property('link', 'string');
    $this->property('rights', 'array');

    $this->has_one('initial_revision', 'ItemRevision');
    $this->has_one('current_revision', 'ItemRevision');
    $this->has_many('fields', 'ItemField');

    # Extra properties for full item
    $this->property('ratings', 'hash');
    $this->property('user_ratings', 'hash');
    $this->property('last_event_on', 'datetime');
    $this->property('participants', 'hash');
    $this->property('tags', 'array');
    $this->property('refs', 'array');
    $this->property('references', 'array');
    $this->property('linked_account_id', 'integer');
    $this->property('subscribed', 'boolean');
    $this->property('invite', 'hash');

    $this->has_one('ref', 'Reference');
    $this->has_one('reminder', 'Reminder');
    $this->has_one('recurrence', 'Recurrence');
    $this->has_many('comments', 'Comment');
    $this->has_many('revisions', 'ItemRevision');
    $this->has_many('files', 'File', array('json_value' => 'file_id', 'json_target' => 'file_ids'));
    $this->has_many('tasks', 'Task');
    $this->has_many('shares', 'AppMarketShare');
    $this->has_many('linked_account_data', 'LinkedAccountData');

    # When getting item collection
    $this->property('comment_count', 'integer');
    $this->property('task_count', 'integer');

    $this->init($attributes);
  }

  /**
   * @see https://developers.podio.com/doc/items/get-item-22360
   */
  public static function get($item_id) {
    return self::member(Podio::get("/item/{$item_id}"));
  }

  /**
   * @see https://developers.podio.com/doc/items/get-item-by-external-id-19556702
   */
  public static function get_by_external_id($app_id, $external_id) {
    return self::member(Podio::get("/item/app/{$app_id}/external_id/{$external_id}"));
  }

  /**
   * @see https://developers.podio.com/doc/items/get-item-basic-61768
   */
  public static function get_basic($item_id, $attributes = array()) {
    return self::member(Podio::get("/item/{$item_id}/basic", $attributes));
  }

  /**
   * @see https://developers.podio.com/doc/items/filter-items-4496747
   */
  public static function filter($app_id, $attributes = array()) {
    return self::collection(Podio::post("/item/app/{$app_id}/filter/", $attributes));
  }

  /**
   * @see https://developers.podio.com/doc/items/filter-items-by-view-4540284
{'fraction_non_alphanumeric': 0.21602126044039482, 'fraction_numerical': 0.010630220197418374, 'mean_word_length': 4.460103626943005, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 71, 'https://': 11, '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': '4471445', 'n_tokens_mistral': 1789, 'n_tokens_neox': 1722, 'n_words': 259}