mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-03-18 07:29:51 +00:00
Merge pull request #215 from bar/1.3-fix-extract
Minor updates to Helper.
This commit is contained in:
commit
b3e57e0feb
1 changed files with 4 additions and 4 deletions
|
@ -573,20 +573,20 @@ class Helper extends Overloadable {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns false if given FORM field has no errors. Otherwise it returns the constant set in
|
* Returns null if given FORM field has no errors. Otherwise it returns the constant set in
|
||||||
* the array Model->validationErrors.
|
* the array Model->validationErrors.
|
||||||
*
|
*
|
||||||
* @param string $model Model name as a string
|
* @param string $model Model name as a string
|
||||||
* @param string $field Fieldname as a string
|
* @param string $field Fieldname as a string
|
||||||
* @param integer $modelID Unique index identifying this record within the form
|
* @param integer $modelID Unique index identifying this record within the form
|
||||||
* @return boolean True on errors.
|
* @return mixed Null if no errors, string with error otherwhise.
|
||||||
*/
|
*/
|
||||||
function tagIsInvalid($model = null, $field = null, $modelID = null) {
|
function tagIsInvalid($model = null, $field = null, $modelID = null) {
|
||||||
$view =& ClassRegistry::getObject('view');
|
$view =& ClassRegistry::getObject('view');
|
||||||
$errors = $this->validationErrors;
|
$errors = $this->validationErrors;
|
||||||
$entity = $view->entity();
|
$entity = $view->entity();
|
||||||
if (!empty($entity)) {
|
if (!empty($entity)) {
|
||||||
return Set::extract($errors, join('.', $entity));
|
return Set::extract(join('.', $entity), $errors);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -704,7 +704,7 @@ class Helper extends Overloadable {
|
||||||
|
|
||||||
$entity = $view->entity();
|
$entity = $view->entity();
|
||||||
if (!empty($this->data) && !empty($entity)) {
|
if (!empty($this->data) && !empty($entity)) {
|
||||||
$result = Set::extract($this->data, join('.', $entity));
|
$result = Set::extract(join('.', $entity), $this->data);
|
||||||
}
|
}
|
||||||
|
|
||||||
$habtmKey = $this->field();
|
$habtmKey = $this->field();
|
||||||
|
|
Loading…
Add table
Reference in a new issue