mirror of
https://github.com/codeigniter4/CodeIgniter4.git
synced 2025-02-20 11:44:28 +08:00
Merge pull request #2570 from nowackipawel/patch-82
Model's set method should accept not only string
This commit is contained in:
commit
11c6008f4c
@ -493,17 +493,18 @@ class Model
|
|||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
||||||
* Captures the builder's set() method so that we can validate the
|
* Captures the builder's set() method so that we can validate the
|
||||||
* data here. This allows it to be used with any of the other
|
* data here. This allows it to be used with any of the other
|
||||||
* builder methods and still get validated data, like replace.
|
* builder methods and still get validated data, like replace.
|
||||||
*
|
*
|
||||||
* @param mixed $key
|
* @param mixed $key Field name, or an array of field/value pairs
|
||||||
* @param string $value
|
* @param string $value Field value, if $key is a single field
|
||||||
* @param boolean|null $escape
|
* @param boolean $escape Whether to escape values and identifiers
|
||||||
*
|
*
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function set($key, string $value = '', bool $escape = null)
|
public function set($key, ?string $value = '', bool $escape = null)
|
||||||
{
|
{
|
||||||
$data = is_array($key)
|
$data = is_array($key)
|
||||||
? $key
|
? $key
|
||||||
|
Loading…
x
Reference in New Issue
Block a user