<commit_before><?php

class CultureFeed_Uitpas_Event_Query_SearchEventsOptions extends CultureFeed_Uitpas_ValueObject {

  const SORT_CREATION_DATE = "CREATION_DATE";
  const SORT_TITLE = "TITLE";
  const SORT_CASHING_PERIOD_END = "CASHING_PERIOD_END";
  const SORT_POINTS = "POINTS";

  const ORDER_ASC = "ASC";
  const ORDER_DESC = "DESC";

  /**
   * Consumer key of the counter
   *
   * @var string
   */
  public $balieConsumerKey;

  /**
   * Begin date
   *
   * @var integer
   */
  public $startDate;

  /**
   * End date
   *
   * @var integer
   */
  public $endDate;

  /**
   * Search for events with a given location ID
   *
   * @var string
   */
  public $locatieId;

  /**
   * Search for events with a given inrichter ID
   *
   * @var string
   */
  public $inrichterId;

  /**
   * Search for events with a given city
   *
   * @var string
   */
  public $city;

  /**
   * Sort field.
   *
   * @var string
   */
  public $sortField;

  /**
   * Sort direction
   *
   * @var string
   */
  public $sortOrder = self::ORDER_DESC;

  /**
   * Maximum number of results. Default: 20
   *
   * @var integer
   */
  public $max = 20;

  /**
   * Results offset. Default: 0
   *
   * @var integer
   */
  public $start = 0;

  /**
   * The Uitpas of the passholder
   *
   * @var string
   */
  public $uitpasNumber;

  /**
   * A search term
   *
   * @var string
   */
  public $q;

  /**
   * The CDBID of the event
   *
   * @var string
   */
  public $cdbid;

  protected function manipulatePostData(&$data) {
    if (isset($data['startDate']) && is_integer($data['startDate'])) {
      $data['startDate'] = date('Y-m-d', $data['startDate']);
    }

    if (isset($data['endDate']) && is_integer($data['endDate'])) {
      $data['endDate'] = date('Y-m-d', $data['endDate']);
    }

    if (isset($data['basicSearch']) && $data['basicSearch']) {
      $data['basicSearch'] = 'true';
    }
    if (isset($data['basicSearch']) && ! $data['basicSearch']) {
      $data['basicSearch'] = 'false';
    }

  }

  /**
   * Read the data from a array and set the variables
   */
  public function readValues($values) {
    foreach($values as $k => $v) {
      $this->$k = $v;
    }

    if (preg_match( "/^[0-9[0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$/", $this->startDate)) {<commit_msg>DECUPAS-92 Pass startDate and endDate parameters as full W3C-formatted dates to cultureevent/search<commit_after><?php

class CultureFeed_Uitpas_Event_Query_SearchEventsOptions extends CultureFeed_Uitpas_ValueObject {

  const SORT_CREATION_DATE = "CREATION_DATE";
  const SORT_TITLE = "TITLE";
  const SORT_CASHING_PERIOD_END = "CASHING_PERIOD_END";
  const SORT_POINTS = "POINTS";

  const ORDER_ASC = "ASC";
  const ORDER_DESC = "DESC";

  /**
   * Consumer key of the counter
   *
   * @var string
   */
  public $balieConsumerKey;

  /**
   * Begin date
   *
   * @var integer
   */
  public $startDate;

  /**
   * End date
   *
   * @var integer
   */
  public $endDate;

  /**
   * Search for events with a given location ID
   *
   * @var string
   */
  public $locatieId;

  /**
   * Search for events with a given inrichter ID
   *
   * @var string
   */
  public $inrichterId;

  /**
   * Search for events with a given city
   *
   * @var string
   */
  public $city;

  /**
   * Sort field.
   *
   * @var string
   */
  public $sortField;

  /**
   * Sort direction
   *
   * @var string
   */
  public $sortOrder = self::ORDER_DESC;

  /**
   * Maximum number of results. Default: 20
   *
   * @var integer
   */
  public $max = 20;

  /**
   * Results offset. Default: 0
   *
   * @var integer
   */
  public $start = 0;

  /**
   * The Uitpas of the passholder
   *
   * @var string
   */
  public $uitpasNumber;

  /**
   * A search term
   *
   * @var string
   */
  public $q;

  /**
   * The CDBID of the event
   *
   * @var string
   */
  public $cdbid;

  protected function manipulatePostData(&$data) {
    if (isset($data['startDate']) && is_integer($data['startDate'])) {
      $data['startDate'] = date(DateTime::W3C, $data['startDate']);
    }

    if (isset($data['endDate']) && is_integer($data['endDate'])) {
      $data['endDate'] = date(DateTime::W3C, $data['endDate']);
    }

    if (isset($data['basicSearch']) && $data['basicSearch']) {
      $data['basicSearch'] = 'true';
    }
    if (isset($data['basicSearch']) && ! $data['basicSearch']) {
      $data['basicSearch'] = 'false';
    }

  }

  /**
   * Read the data from a array and set the variables
   */
  public function readValues($values) {
    foreach($values as $k => $v) {
      $this->$k = $v;
    }

    if (preg_match( "/^[0-9[0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$/", $this->startDate)) {
{'fraction_non_alphanumeric': 0.16531569965870307, 'fraction_numerical': 0.010452218430034129, 'mean_word_length': 2.4914370811615787, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '4265296', 'n_tokens_mistral': 1745, 'n_tokens_neox': 1681, 'n_words': 381}