Permalink
Browse files

making schema method work

  • Loading branch information...
1 parent dca96ae commit 0936bb21c9fa6655a9d931071d85d9af337e67ed @gwoo gwoo committed Nov 17, 2010
Showing with 9 additions and 9 deletions.
  1. +9 −9 extensions/adapter/data/source/database/SqlSrv.php
@@ -287,25 +287,25 @@ public function value($value, array $schema = array()) {
* @param object $context
* @return array
*/
- public function schema($query, $resource = null, $context = null) {
+ public function schema($query, $result = null, $context = null) {
if (is_object($query)) {
- return parent::schema($query, $resource, $context);
+ return parent::schema($query, $result, $context);
}
- $result = array();
- $count = sqlsrv_num_fields($resource);
+ $fields = array();
+ $count = sqlsrv_num_fields($result->resource());
- foreach (sqlsrv_field_metadata($resource) as $name => $value) {
+ foreach (sqlsrv_field_metadata($result->resource()) as $name => $value) {
if ($name === 'Name') {
- $result[] = $value;
+ $fields[] = $value;
}
}
- return $result;
+ return $fields;
}
-
+
public function encoding($encoding = null) {
return true;
}
-
+
/**
* Retrieves database error message and error code.
*

0 comments on commit 0936bb2

Please sign in to comment.