phpOpenTracker/phpOpenTracker/API Result.php,1.2,1.3
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-serv21234/phpOpenTracker/API
Modified Files:
Result.php
Log Message:
Implement phpOpenTracker_API_Result::__toString().
Index: Result.php
===================================================================
RCS file: /cvsroot/phpopencounter/phpOpenTracker/phpOpenTracker/API/Result.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Result.php 22 Nov 2003 16:12:59 -0000 1.2
--- Result.php 23 Nov 2003 18:20:34 -0000 1.3
***************
*** 17,20 ****
--- 17,21 ----
class phpOpenTracker_API_Result implements IteratorAggregate {
protected $result;
+ protected $parameters;
protected $supportedFormats = array(
'array' => true,
***************
*** 23,32 ****
);
! public function __construct($result, $supportedFormats = array()) {
! $this->result = $result;
if (!empty($supportedFormats)) {
$this->supportedFormats = $supportedFormats;
}
}
--- 24,44 ----
);
! public function __construct($result, $parameters, $supportedFormats = array()) {
! $this->result = $result;
! $this->parameters = $parameters;
if (!empty($supportedFormats)) {
$this->supportedFormats = $supportedFormats;
}
+ }
+
+ public function __toString() {
+ $string = '';
+
+ foreach ($this->parameters as $parameter => $value) {
+ $string .= $parameter . ': ' . $value . "\n";
+ }
+
+ return $string;
}
-------------------------------------------------------
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/