From 833606063f115b27280b6d285d7c7a07d41361ea Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Fri, 25 Jan 2008 12:25:21 -0500 Subject: [PATCH] Add fluent interfaces for set() functions in BSPrinterelement * PrinterElement.php (BSPrinterElement::setActive): Return $this (BSPrinterElement::setOnClick): ditto (BSPrinterElement::setAccessKey): ditto (BSPrinterElement::setName): ditto --- PrinterElement.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/PrinterElement.php b/PrinterElement.php index 2fdb769..6b1aa39 100644 --- a/PrinterElement.php +++ b/PrinterElement.php @@ -111,6 +111,8 @@ class BSPrinterElement extends BSPrinterAbstract * set the selected/checked attribute * * @param boolean Active? + * + * @return fluent interface */ public function setActive($active) { @@ -119,6 +121,7 @@ class BSPrinterElement extends BSPrinterAbstract throw new Exception('BSPrinterElement::setActive() can only be used on elements of type checkbox, radio, or option'); } $this->active = $active; + return $this; } // ################################################################### @@ -126,10 +129,13 @@ class BSPrinterElement extends BSPrinterAbstract * Sets the JavaScript onclick action * * @param string onClick attribute value + * + * @return fluent interface */ public function setOnClick($onClick) { $this->onClick = $onClick; + return $this; } // ################################################################### @@ -137,10 +143,13 @@ class BSPrinterElement extends BSPrinterAbstract * Sets the accesskey attribute value * * @param string Access key + * + * @return fluent interface */ public function setAccessKey($accessKey) { $this->accessKey = $accessKey; + return $this; } // ################################################################### @@ -170,10 +179,13 @@ class BSPrinterElement extends BSPrinterAbstract * Sets the name of the element * * @param string A new name + * + * @return fluent interface */ public function setName($name) { $this->name = $name; + return $this; } // ################################################################### -- 2.22.5