public function schema($query, $resource = null, $context = null) { if (isset($this->return['schema'])) { return $this->return['schema']; } return parent::schema($query, $resource = null, $context = null); }
/** * In cases where the query is a raw string (as opposed to a `Query` object), to database must * determine the correct column names from the result resource. * * @param mixed $query * @param resource $resource * @param object $context * @return array */ public function schema($query, $resource = null, $context = null) { if (is_object($query)) { return parent::schema($query, $resource, $context); } $result = array(); $count = $resource->numColumns(); for ($i = 0; $i < $count; $i++) { $result[] = $resource->columnName($i); } return $result; }
/** * In cases where the query is a raw string (as opposed to a `Query` object), to database must * determine the correct column names from the result resource. * * @param mixed $query * @param resource $resource * @param object $context * @return array */ public function schema($query, $resource = null, $context = null) { if (is_object($query)) { return parent::schema($query, $resource, $context); } $result = array(); $count = mysql_num_fields($resource->resource()); for ($i = 0; $i < $count; $i++) { $result[] = mysql_field_name($resource->resource(), $i); } return $result; }
/** * In cases where the query is a raw string (as opposed to a `Query` object), to database must * determine the correct column names from the result resource. * * @param mixed $query * @param resource $resource * @param object $context * @return array */ public function schema($query, $resource = null, $context = null) { if (is_object($query)) { return parent::schema($query, $resource, $context); } $result = array(); $count = $resource->resource()->columnCount(); for ($i = 0; $i < $count; $i++) { $meta = $resource->resource()->getColumnMeta($i); $result[] = $meta['name']; } return $result; }