mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-02-07 12:36:25 +00:00
updating scope in Helper::setEntity()
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5981 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
25252e678a
commit
6c0e70faa5
2 changed files with 4 additions and 4 deletions
|
@ -329,11 +329,11 @@ class Helper extends Overloadable {
|
|||
$parts = preg_split('/\/|\./', $entity);
|
||||
|
||||
if($parts[0] !== $view->model) {
|
||||
$sameScope = true;
|
||||
if (ClassRegistry::isKeySet($view->model)) {
|
||||
$modelObj =& ClassRegistry::getObject($view->model);
|
||||
for ($i = 0; $i < count($parts); $i++) {
|
||||
if ($modelObj->hasField($parts[$i]) || array_key_exists($parts[$i], $modelObj->validate)) {
|
||||
$sameScope = true;
|
||||
$hasField = $i;
|
||||
break;
|
||||
}
|
||||
|
@ -342,10 +342,10 @@ class Helper extends Overloadable {
|
|||
}
|
||||
|
||||
if (ClassRegistry::isKeySet($parts[0])) {
|
||||
$sameScope = false;
|
||||
$newModelObj =& ClassRegistry::getObject($parts[0]);
|
||||
for ($i = 1; $i < count($parts); $i++) {
|
||||
if ($newModelObj->hasField($parts[$i]) || array_key_exists($parts[$i], $newModelObj->validate)) {
|
||||
$sameScope = false;
|
||||
$hasField = $i;
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue