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
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Rotua Panjaitan
yii2
Commits
8de3ffab
Commit
8de3ffab
authored
Jun 22, 2013
by
Alexander Kochetov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ActiveRecord::setAttribute() bugfix
parent
6fd1c166
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
0 deletions
+5
-0
ActiveRecord.php
framework/yii/db/ActiveRecord.php
+5
-0
No files found.
framework/yii/db/ActiveRecord.php
View file @
8de3ffab
...
@@ -523,11 +523,16 @@ class ActiveRecord extends Model
...
@@ -523,11 +523,16 @@ class ActiveRecord extends Model
* Sets the named attribute value.
* Sets the named attribute value.
* @param string $name the attribute name
* @param string $name the attribute name
* @param mixed $value the attribute value.
* @param mixed $value the attribute value.
* @throws InvalidParamException if the named attribute does not exist.
* @see hasAttribute
* @see hasAttribute
*/
*/
public
function
setAttribute
(
$name
,
$value
)
public
function
setAttribute
(
$name
,
$value
)
{
{
if
(
isset
(
$this
->
_attributes
[
$name
])
||
isset
(
$this
->
getTableSchema
()
->
columns
[
$name
]))
{
$this
->
_attributes
[
$name
]
=
$value
;
$this
->
_attributes
[
$name
]
=
$value
;
}
else
{
throw
new
InvalidParamException
(
get_class
(
$this
)
.
' has no attribute named "'
.
$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