Add a __toString() method on BSPrinterAbstract
authorRobert Sesek <rsesek@bluestatic.org>
Tue, 8 Apr 2008 17:40:34 +0000 (13:40 -0400)
committerRobert Sesek <rsesek@bluestatic.org>
Tue, 8 Apr 2008 17:40:34 +0000 (13:40 -0400)
* PrinterAbstract.php:
(BSPrinterAbstract::__toString): New method that calls paint()

CHANGES
PrinterAbstract.php

diff --git a/CHANGES b/CHANGES
index 32e7941bdcbafb94cf491c1d38fef35984474392..690c3d6b0ad3fa294515866cc1b696aa27a6bec0 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -6,3 +6,4 @@
 - New: BSPrinterAbstract::setId() allows all elements to have an id attribute added in _prepareStyle()
 - New: Added an ability to quick-set API information via an array with BSApi::setArray()
 - New: Made many private members protected or public
+- Change: Added BSPrinterAbstract::__toString() that merely calls paint()
index 08a91abe62b685b42bd161f347c62c78b68f15ae..dddabe2472d71858bcd8ca0f90ac39e3a4621f95 100644 (file)
@@ -66,6 +66,14 @@ abstract class BSPrinterAbstract
         */
        public abstract function paint();
        
+       /**
+        * To-string method which invokes paint()
+        */
+       public function __toString()
+       {
+               return $this->paint();
+       }
+       
        /**
         * Sets the CSS class to use. Use ":swap:" to alternate
         *