Created
May 10, 2011 11:47
-
-
Save tonyhb/964325 to your computer and use it in GitHub Desktop.
Set example from Kohana
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function set($values, $value = NULL) | |
{ | |
if ($value) | |
{ | |
// Normalise single field setting to multiple field setting | |
$values = array($values => $value); | |
} | |
if ( ! $values) | |
return $this; | |
foreach ($values as $key => $value) | |
{ | |
$this->_data[$key] = $value; | |
} | |
return $this; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment