src/wcmf/lib/model/StringQuery.php
protected static function mapToDatabase($type, $valueName) {
    $mapper = self::getMapper($type);
    if ($mapper->hasAttribute($valueName)) {
      $attributeDescription = $mapper->getAttribute($valueName);
    }
    else {
      // if the attribute does not exist, it might be the column name already
      foreach ($mapper->getAttributes() as $curAttributeDesc) {
        if ($curAttributeDesc->getColumn() == $valueName) {
          $attributeDescription = $curAttributeDesc;
          break;
        }
      }
    }
    if (!$attributeDescription) {
      throw new PersistenceException("No attribute '".$valueName."' exists in '".$type."'");
    }

    $table = $mapper->getRealTableName();
    $column = $attributeDescription->getColumn();
    return [$table, $column];
  }
protected static function mapToDatabase($type, $valueName) {
    $mapper = self::getMapper($type);
    if ($mapper->hasAttribute($valueName)) {
      $attributeDescription = $mapper->getAttribute($valueName);
    }
    else {
      // if the attribute does not exist, it might be the column name already
      foreach ($mapper->getAttributes() as $curAttributeDesc) {
        if ($curAttributeDesc->getColumn() == $valueName) {
          $attributeDescription = $curAttributeDesc;
          break;
        }
      }
    }
    if (!$attributeDescription) {
      throw new PersistenceException("No attribute '".$valueName."' exists in '".$type."'");
    }

    $table = $mapper->getRealTableName();
    $column = $attributeDescription->getColumn();
    return [$table, $column];
  }
protected static function mapToDatabase ( $ type , $ valueName ) { $ mapper = self :: getMapper ( $ type ) ; if ( $ mapper -> hasAttribute ( $ valueName ) ) { $ attributeDescription = $ mapper -> getAttribute ( $ valueName ) ; } else { // if the attribute does not exist, it might be the column name already foreach ( $ mapper -> getAttributes ( ) as $ curAttributeDesc ) { if ( $ curAttributeDesc -> getColumn ( ) == $ valueName ) { $ attributeDescription = $ curAttributeDesc ; break ; } } } if ( ! $ attributeDescription ) { throw new PersistenceException ( "No attribute '" . $ valueName . "' exists in '" . $ type . "'" ) ; } $ table = $ mapper -> getRealTableName ( ) ; $ column = $ attributeDescription -> getColumn ( ) ; return [ $ table , $ column ] ; }
Map a application type and value name to the appropriate database names
@param $type The type to map
@param $valueName The name of the value to map
@return An array with the table and column name or null if no mapper is found
Map a application type and value name to the appropriate database names