return $result;
}
+ /**\r
+ * Return an array of files where the name starts with $prefix.\r
+ *\r
+ * @param string $prefix The prefix to search for\r
+ * @param int $limit The maximum amount of files to return\r
+ * @return array\r
+ */\r
+ public function findFilesByPrefix( $prefix, $limit ) {
+ $selectOptions = array( 'ORDER BY' => 'img_name', 'LIMIT' => intval( $limit ) );
+
+ // Query database\r
+ $dbr = $this->getSlaveDB();
+ $res = $dbr->select(
+ 'image',
+ LocalFile::selectFields(),
+ 'img_name ' . $dbr->buildLike( $prefix, $dbr->anyString() ),
+ __METHOD__,
+ $selectOptions
+ );
+
+ // Build file objects
+ $files = array();
+ foreach ( $res as $row ) {
+ $files[] = $this->newFileFromRow( $row );
+ }
+ return $files;\r
+ }
+
/**
* Get a connection to the slave DB
* @return DatabaseBase