<commit_before><?php

namespace Kula\HEd\Bundle\SchoolBundle\Chooser;

use Kula\Core\Component\Chooser\Chooser;

class StaffSchoolTermChooser extends Chooser {
  
  public function search($q) {
    
    $query_conditions = $this->db()->db_and();
    $query_conditions = $query_conditions->condtion('stafforgtrm.ORGANIZATION_TERM_ID', $this->focus()->getOrganizationTermIDs());
    
    $query_conditions_or = $this->db()->db_or();
    $query_conditions_or = $query_conditions_or->condtion('ABBREVIATED_NAME', $q.'%', 'LIKE');
    
    $query_conditions = $query_conditions->condtion($query_conditions_or);
    
    $data = array();
    
    $search = $this->db()->db_select('STUD_STAFF_ORGANIZATION_TERMS', 'stafforgtrm')
      ->fields('stafforgtrm', array('STAFF_ORGANIZATION_TERM_ID'))
      ->join('STUD_STAFF', 'staff', 'stafforgtrm.STAFF_ID = staff.STAFF_ID')
      ->fields('staff', array('ABBREVIATED_NAME'))
      ->condition($query_conditions)
      ->orderBy('ABBREVIATED_NAME', 'ASC');
    $search = $search->execute();
    while ($row = $search->fetch()) {
      $this->addToChooserMenu($row['STAFF_ORGANIZATION_TERM_ID'], $row['ABBREVIATED_NAME']);
    }
    
  }
  
  public function choice($id) {
    $row = $this->db()->db_select('STUD_STAFF_ORGANIZATION_TERMS', 'stafforgtrm')
      ->fields('stafforgtrm', array('STAFF_ORGANIZATION_TERM_ID'))<commit_msg>Fix school staff term chooser loading.<commit_after><?php

namespace Kula\HEd\Bundle\SchoolBundle\Chooser;

use Kula\Core\Component\Chooser\Chooser;

class StaffSchoolTermChooser extends Chooser {
  
  public function search($q) {
    
    $query_conditions = $this->db()->db_and();
    $query_conditions = $query_conditions->condition('stafforgtrm.ORGANIZATION_TERM_ID', $this->focus()->getOrganizationTermIDs());
    
    $query_conditions_or = $this->db()->db_or();
    $query_conditions_or = $query_conditions_or->condition('ABBREVIATED_NAME', $q.'%', 'LIKE');
    
    $query_conditions = $query_conditions->condition($query_conditions_or);
    
    $data = array();
    
    $search = $this->db()->db_select('STUD_STAFF_ORGANIZATION_TERMS', 'stafforgtrm')
      ->fields('stafforgtrm', array('STAFF_ORGANIZATION_TERM_ID'))
      ->join('STUD_STAFF', 'staff', 'stafforgtrm.STAFF_ID = staff.STAFF_ID')
      ->fields('staff', array('ABBREVIATED_NAME'))
      ->condition($query_conditions)
      ->orderBy('ABBREVIATED_NAME', 'ASC');
    $search = $search->execute();
    while ($row = $search->fetch()) {
      $this->addToChooserMenu($row['STAFF_ORGANIZATION_TERM_ID'], $row['ABBREVIATED_NAME']);
    }
    
  }
  
  public function choice($id) {
    $row = $this->db()->db_select('STUD_STAFF_ORGANIZATION_TERMS', 'stafforgtrm')
      ->fields('stafforgtrm', array('STAFF_ORGANIZATION_TERM_ID'))
{'fraction_non_alphanumeric': 0.16906993511175197, 'fraction_numerical': 0.0, 'mean_word_length': 4.769230769230769, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 47, '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': '7248676', 'n_tokens_mistral': 1007, 'n_tokens_neox': 967, 'n_words': 116}