mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Added a clear() function to Model.php (2.4 branch)
1.) Changed Pull Request from master branch to 2.4 (Old Pull Request: https://github.com/cakephp/cakephp/pull/1323) 2.) Updated return value in comment
This commit is contained in:
parent
f3c69c9f40
commit
089c9e1139
1 changed files with 11 additions and 0 deletions
|
@ -1497,6 +1497,17 @@ class Model extends Object implements CakeEventListener {
|
|||
}
|
||||
return $this->data;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function is a convenient wrapper class to create(false) and, as the name suggests, clears the id, data, and validation errors.
|
||||
*
|
||||
* @return always boolean TRUE upon success
|
||||
* @see Model::create()
|
||||
*/
|
||||
public function clear() {
|
||||
$this->create(false);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list of fields from the database, and sets the current model
|
||||
|
|
Loading…
Reference in a new issue