public static function checkFieldExists(TableMap $tableMap, $field)
    {
        $column = null;
        try {
            foreach($tableMap->getColumns() as $tableMapColumn) {
                $columnName = $tableMapColumn->getPhpName();
                if(preg_match('/^'.$field.'$/i', $columnName)) {
                    $column = $tableMapColumn;
                    break;
                }
            }
        } catch (\Exception $e) {
            Logger::log($e->getMessage(), LOG_DEBUG);
        }
        return $column;
    }
public static function checkFieldExists(TableMap $tableMap, $field)
    {
        $column = null;
        try {
            foreach($tableMap->getColumns() as $tableMapColumn) {
                $columnName = $tableMapColumn->getPhpName();
                if(preg_match('/^'.$field.'$/i', $columnName)) {
                    $column = $tableMapColumn;
                    break;
                }
            }
        } catch (\Exception $e) {
            Logger::log($e->getMessage(), LOG_DEBUG);
        }
        return $column;
    }
public static function checkFieldExists ( TableMap $ tableMap , $ field ) { $ column = null ; try { foreach ( $ tableMap -> getColumns ( ) as $ tableMapColumn ) { $ columnName = $ tableMapColumn -> getPhpName ( ) ; if ( preg_match ( '/^' . $ field . '$/i' , $ columnName ) ) { $ column = $ tableMapColumn ; break ; } } } catch ( \ Exception $ e ) { Logger :: log ( $ e -> getMessage ( ) , LOG_DEBUG ) ; } return $ column ; }
Check if parametrized field exists in api model
@param TableMap $tableMap
@param $field
@return \Propel\Runtime\Map\ColumnMap|null
Check if parametrized field exists in api model