Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
c4468ac3
Commit
c4468ac3
authored
Nov 07, 2013
by
Carsten Brandt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
forgot to remove strtolower from __get and __unset
parent
a23c54ac
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
7 deletions
+5
-7
ActiveRecord.php
framework/yii/db/ActiveRecord.php
+5
-7
No files found.
framework/yii/db/ActiveRecord.php
View file @
c4468ac3
...
@@ -379,13 +379,12 @@ class ActiveRecord extends Model
...
@@ -379,13 +379,12 @@ class ActiveRecord extends Model
}
elseif
(
$this
->
hasAttribute
(
$name
))
{
}
elseif
(
$this
->
hasAttribute
(
$name
))
{
return
null
;
return
null
;
}
else
{
}
else
{
$t
=
strtolower
(
$name
);
if
(
isset
(
$this
->
_related
[
$name
])
||
array_key_exists
(
$name
,
$this
->
_related
))
{
if
(
isset
(
$this
->
_related
[
$t
])
||
array_key_exists
(
$t
,
$this
->
_related
))
{
return
$this
->
_related
[
$name
];
return
$this
->
_related
[
$t
];
}
}
$value
=
parent
::
__get
(
$name
);
$value
=
parent
::
__get
(
$name
);
if
(
$value
instanceof
ActiveRelation
)
{
if
(
$value
instanceof
ActiveRelation
)
{
return
$this
->
_related
[
$
t
]
=
$value
->
multiple
?
$value
->
all
()
:
$value
->
one
();
return
$this
->
_related
[
$
name
]
=
$value
->
multiple
?
$value
->
all
()
:
$value
->
one
();
}
else
{
}
else
{
return
$value
;
return
$value
;
}
}
...
@@ -433,9 +432,8 @@ class ActiveRecord extends Model
...
@@ -433,9 +432,8 @@ class ActiveRecord extends Model
if
(
$this
->
hasAttribute
(
$name
))
{
if
(
$this
->
hasAttribute
(
$name
))
{
unset
(
$this
->
_attributes
[
$name
]);
unset
(
$this
->
_attributes
[
$name
]);
}
else
{
}
else
{
$t
=
strtolower
(
$name
);
if
(
isset
(
$this
->
_related
[
$name
]))
{
if
(
isset
(
$this
->
_related
[
$t
]))
{
unset
(
$this
->
_related
[
$name
]);
unset
(
$this
->
_related
[
$t
]);
}
else
{
}
else
{
parent
::
__unset
(
$name
);
parent
::
__unset
(
$name
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment