public static function getSingleTableTypeMap() {
    $calledClass = get_called_class();

    if (array_key_exists($calledClass, self::$singleTableTypeMap) ){
      return self::$singleTableTypeMap[$calledClass];
    }

    $typeMap = [];

    // Check if the calledClass is a leaf of the hierarchy. singleTableSubclasses will be inherited from the parent class
    // so its important we check for the tableType first otherwise we'd infinitely recurse.
    if (property_exists($calledClass, 'singleTableType')) {
      $classType = static::$singleTableType;
      $typeMap[$classType] = $calledClass;
    }
    if (property_exists($calledClass, 'singleTableSubclasses')) {
      $subclasses = static::$singleTableSubclasses;
      // prevent infinite recursion if the singleTableSubclasses is inherited
      if (!in_array($calledClass, $subclasses)) {
        foreach ($subclasses as $subclass) {
          $typeMap = $typeMap + $subclass::getSingleTableTypeMap();
        }
      }
    }

    self::$singleTableTypeMap[$calledClass] = $typeMap;

    return $typeMap;
  }
public static function getSingleTableTypeMap() {
    $calledClass = get_called_class();

    if (array_key_exists($calledClass, self::$singleTableTypeMap) ){
      return self::$singleTableTypeMap[$calledClass];
    }

    $typeMap = [];

    // Check if the calledClass is a leaf of the hierarchy. singleTableSubclasses will be inherited from the parent class
    // so its important we check for the tableType first otherwise we'd infinitely recurse.
    if (property_exists($calledClass, 'singleTableType')) {
      $classType = static::$singleTableType;
      $typeMap[$classType] = $calledClass;
    }
    if (property_exists($calledClass, 'singleTableSubclasses')) {
      $subclasses = static::$singleTableSubclasses;
      // prevent infinite recursion if the singleTableSubclasses is inherited
      if (!in_array($calledClass, $subclasses)) {
        foreach ($subclasses as $subclass) {
          $typeMap = $typeMap + $subclass::getSingleTableTypeMap();
        }
      }
    }

    self::$singleTableTypeMap[$calledClass] = $typeMap;

    return $typeMap;
  }
public static function getSingleTableTypeMap ( ) { $ calledClass = get_called_class ( ) ; if ( array_key_exists ( $ calledClass , self :: $ singleTableTypeMap ) ) { return self :: $ singleTableTypeMap [ $ calledClass ] ; } $ typeMap = [ ] ; // Check if the calledClass is a leaf of the hierarchy. singleTableSubclasses will be inherited from the parent class // so its important we check for the tableType first otherwise we'd infinitely recurse. if ( property_exists ( $ calledClass , 'singleTableType' ) ) { $ classType = static :: $ singleTableType ; $ typeMap [ $ classType ] = $ calledClass ; } if ( property_exists ( $ calledClass , 'singleTableSubclasses' ) ) { $ subclasses = static :: $ singleTableSubclasses ; // prevent infinite recursion if the singleTableSubclasses is inherited if ( ! in_array ( $ calledClass , $ subclasses ) ) { foreach ( $ subclasses as $ subclass ) { $ typeMap = $ typeMap + $ subclass :: getSingleTableTypeMap ( ) ; } } } self :: $ singleTableTypeMap [ $ calledClass ] = $ typeMap ; return $ typeMap ; }
Get the map of type field values to class names.
@return array the type map
Get the map of type field values to class names .