Skip to content

Commit

Permalink
request #14979: fluent interface for setPageID() and setParams() and …
Browse files Browse the repository at this point in the history
…for setOption() and setOptions() decorator methods

git-svn-id: http://svn.php.net/repository/pear/packages/Translation2/trunk@268999 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information
quipo committed Nov 14, 2008
1 parent 21f4ce7 commit 9a6fc79
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 9 deletions.
3 changes: 2 additions & 1 deletion Decorator.php
Expand Up @@ -105,7 +105,7 @@ function Translation2_Decorator(& $translation2)
*
* @param array $options decorator options
*
* @return void
* @return self
*/
function setOptions($options=array())
{
Expand All @@ -114,6 +114,7 @@ function setOptions($options=array())
$this->setOption($option, $value);
}
}
return $this;
}

// }}}
Expand Down
3 changes: 2 additions & 1 deletion Decorator/CacheLiteFunction.php
Expand Up @@ -189,14 +189,15 @@ function setLang($langID)
* @param string $name name of the option
* @param string $value new value of the option
*
* @return void
* @return self
* @access public
* @see Cache_Lite::setOption()
*/
function setCacheOption($name, $value)
{
$this->_prepare();
$this->cacheLiteFunction->setOption($name, $value);
return $this;
}

// }}}
Expand Down
6 changes: 4 additions & 2 deletions Translation2.php
Expand Up @@ -319,11 +319,12 @@ function setLang($langID)
*
* @param string $pageID ID of the default page
*
* @return void
* @return self
*/
function setPageID($pageID = null)
{
$this->currentPageID = $pageID;
return $this;
}

// }}}
Expand Down Expand Up @@ -392,7 +393,7 @@ function getLangs($format = 'name')
*
* @param array $params array of replacement parameters
*
* @return void
* @return self
*/
function setParams($params = null)
{
Expand All @@ -403,6 +404,7 @@ function setParams($params = null)
} else {
$this->params = array($params);
}
return $this;
}

// }}}
Expand Down
16 changes: 11 additions & 5 deletions package.xml
Expand Up @@ -45,8 +45,8 @@ Currently, the following decorators are provided:
<email>mike@php.net</email>
<active>yes</active>
</developer>
<date>2008-11-09</date>
<time>19:55:00</time>
<date>2008-11-14</date>
<time>16:24:00</time>
<version>
<release>2.0.1</release>
<api>2.0.1</api>
Expand All @@ -59,7 +59,9 @@ Currently, the following decorators are provided:
<notes>- fixed bug #13933: undefined variable in the dataobjectsimple driver
- fixed bug #14323: wrong / no error from setLang() [cwiedmann]
- fixed bug in getLangs(), where certain formats were not recognized
- request #14979: fluent interface for decorator's setOption() method
- request #14979: fluent interface for setPageID() and setParams()
and for setOption() and setOptions() decorator methods
- request #15000: added SQL example in the /docs/examples dir
</notes>
<contents>
<dir name="/">
Expand Down Expand Up @@ -103,8 +105,10 @@ Currently, the following decorators are provided:
<file baseinstalldir="Translation2" name="gettext_prepare.php" role="doc" />
<file baseinstalldir="Translation2" name="gettext_settings.php" role="doc" />
<file baseinstalldir="Translation2" name="settings.php" role="doc" />
<file baseinstalldir="Translation2" name="settings_multitable.php role="doc" />
<file baseinstalldir="Translation2" name="Translation2_example.php" role="doc" />
<file baseinstalldir="Translation2" name="Translation2_example.sql" role="doc" />
<file baseinstalldir="Translation2" name="Translation2_example_multitable.sql" role="doc" />
<file baseinstalldir="Translation2" name="Translation2_gettext_example.php" role="doc" />
</dir> <!-- /docs/examples -->
<file baseinstalldir="Translation2" name="gettext_readme.txt" role="doc" />
Expand Down Expand Up @@ -203,12 +207,14 @@ Currently, the following decorators are provided:
<release>stable</release>
<api>stable</api>
</stability>
<date>2008-11-09</date>
<date>2008-11-14</date>
<license uri="http://www.debian.org/misc/bsd.license">BSD</license>
<notes>- fixed bug #13933: undefined variable in the dataobjectsimple driver
- fixed bug #14323: wrong / no error from setLang() [cwiedmann]
- fixed bug in getLangs(), where certain formats were not recognized
- request #14979: fluent interface for decorator's setOption() method
- request #14979: fluent interface for setPageID() and setParams()
and for setOption() and setOptions() decorator methods
- request #15000: added SQL example in the /docs/examples dir
</notes>
</release>
<release>
Expand Down

0 comments on commit 9a6fc79

Please sign in to comment.