phpOpenTracker/phpOpenTracker/API Result.php,1.1,1.2
Sebastian Bergmann <[email protected]>
| Newsgroups | gmane.comp.web.phpopentracker.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/phpopencounter/phpOpenTracker/phpOpenTracker/API
In directory sc8-pr-cvs1:/tmp/cvs-serv12593/phpOpenTracker/API
Modified Files:
Result.php
Log Message:
Flush.
Index: Result.php
===================================================================
RCS file: /cvsroot/phpopencounter/phpOpenTracker/phpOpenTracker/API/Result.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** Result.php 22 Nov 2003 08:47:43 -0000 1.1
--- Result.php 22 Nov 2003 16:12:59 -0000 1.2
***************
*** 17,42 ****
class phpOpenTracker_API_Result implements IteratorAggregate {
protected $result;
! protected $supportedFormats;
public function __construct($result, $supportedFormats = array()) {
! $this->result = $result;
! $this->supportedFormats = $supportedFormats;
}
public function getAsArray() {
! return $this->result;
}
public function getAsCSV() {
! $csv = implode(';', array_keys($this->result[0])) . "\n";
! foreach ($this->result as $row) {
! $csv .= implode(';', $row) . "\n";
! }
! return $csv;
}
public function getAsXML() {
}
--- 17,62 ----
class phpOpenTracker_API_Result implements IteratorAggregate {
protected $result;
! protected $supportedFormats = array(
! 'array' => true,
! 'csv' => true,
! 'xml' => true
! );
public function __construct($result, $supportedFormats = array()) {
! $this->result = $result;
!
! if (!empty($supportedFormats)) {
! $this->supportedFormats = $supportedFormats;
! }
}
public function getAsArray() {
! if ($this->supportedFormats['array']) {
! return $this->result;
! } else {
! return false;
! }
}
public function getAsCSV() {
! if ($this->supportedFormats['csv']) {
! $csv = implode(';', array_keys($this->result[0])) . "\n";
! foreach ($this->result as $row) {
! $csv .= implode(';', $row) . "\n";
! }
! return $csv;
! } else {
! return false;
! }
}
public function getAsXML() {
+ if ($this->supportedFormats['xml']) {
+ // ...
+ } else {
+ return false;
+ }
}
-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive? Does it
help you create better code? SHARE THE LOVE, and help us help
YOU! Click Here: http://sourceforge.net/donate/