original_string: public function getFilter($filterId)
      {
          static $filters = array();
  
          if (isset($filters[$filterId])) {
              return $filters[$filterId];
          }
          $found = $this->getFilters("SELECT *
                  FROM gems__appointment_filters LEFT JOIN gems__track_appointments ON gaf_id = gtap_filter_id
                  WHERE gaf_active = 1 AND gaf_id = $filterId LIMIT 1");
  
          if ($found) {
              $filters[$filterId] = reset($found);
              return $filters[$filterId];
          }
      }
code: public function getFilter($filterId)
      {
          static $filters = array();
  
          if (isset($filters[$filterId])) {
              return $filters[$filterId];
          }
          $found = $this->getFilters("SELECT *
                  FROM gems__appointment_filters LEFT JOIN gems__track_appointments ON gaf_id = gtap_filter_id
                  WHERE gaf_active = 1 AND gaf_id = $filterId LIMIT 1");
  
          if ($found) {
              $filters[$filterId] = reset($found);
              return $filters[$filterId];
          }
      }
code_tokens: public function getFilter ( $ filterId ) { static $ filters = array ( ) ; if ( isset ( $ filters [ $ filterId ] ) ) { return $ filters [ $ filterId ] ; } $ found = $ this -> getFilters ( "SELECT *
                  FROM gems__appointment_filters LEFT JOIN gems__track_appointments ON gaf_id = gtap_filter_id
                  WHERE gaf_active = 1 AND gaf_id = $filterId LIMIT 1" ) ; if ( $ found ) { $ filters [ $ filterId ] = reset ( $ found ) ; return $ filters [ $ filterId ] ; } }
docstring: Get a filter from the database
  
  @param $filterId Id of a single filter
  @return AppointmentFilterInterface or null
docstring_tokens: Get a filter from the database