Created
November 1, 2011 16:36
-
-
Save chrismeller/1331052 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Model_Browser extends Model { | |
public function list_schemas ( $like = null ) { | |
$query = \DB::select( array( 'table_schem', 'schema' ) )->from( 'sysibm.sqltables' ); | |
if ( $like != null ) { | |
$query->where( 'table_schem', 'like', $like ); | |
} | |
$query->order_by('schema'); | |
// make it distinct | |
$query->distinct(); | |
// we want an object back | |
$query->as_object(); | |
// execute! | |
$result = $query->execute(); | |
return $result; | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment