예제 #1
0
  /** Converts the simple $search_field_defs into canonical - 
   * THIS HAS THE NORMALIZED DEFINITION OF THE FIELDS FROM THE SEARCH CLASS
   * It is used to build the table field defs, but information is stripped.
   * We should merge the two - this w. getBasenameQueryDef
   * @return array of assoc arrays of min: [$basename => ['fieldtype' => $fieldtype]
   */

  public static function getSearchFieldDefs() {
    $configStruct = ['fieldtype',
        'fieldtype' => 'integer',
        'comptype' => 'numeric',
    ];
    return normalizeConfigArray(static::$search_field_defs, $configStruct);
  }
예제 #2
0
 /** Does two entirely different things - by default, 
  * Just returns an indexed array of field names
  * But if $onlyrefs = true, ONLY RETURNS display value fields mapped to 
  * PkRef classes
  */
 public static function getDisplayValueFields($onlyrefs = false)
 {
     if ($onlyrefs) {
         $refarr = [];
         foreach (static::$display_value_fields as $key => $value) {
             //if (is_string ($key) && is_string($value)) {
             if (is_string($key) && $value) {
                 $refarr[$key] = $value;
             }
         }
         return $refarr;
     }
     if (!static::$display_value_fields || !count(static::$display_value_fields)) {
         return [];
     }
     $normalized = normalizeConfigArray(static::$display_value_fields);
     if (is_array($normalized)) {
         return array_keys($normalized);
     }
     return [];
 }