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
a97f6387
Commit
a97f6387
authored
Feb 02, 2014
by
Vladimir Zbrailov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added check column
parent
6de3e144
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
ActiveRecord.php
framework/db/ActiveRecord.php
+5
-1
No files found.
framework/db/ActiveRecord.php
View file @
a97f6387
...
@@ -284,7 +284,11 @@ class ActiveRecord extends BaseActiveRecord
...
@@ -284,7 +284,11 @@ class ActiveRecord extends BaseActiveRecord
$schema
=
static
::
getTableSchema
();
$schema
=
static
::
getTableSchema
();
foreach
(
$row
as
$name
=>
$value
)
{
foreach
(
$row
as
$name
=>
$value
)
{
if
(
isset
(
$columns
[
$name
]))
{
if
(
isset
(
$columns
[
$name
]))
{
$record
->
setAttribute
(
$name
,
$schema
->
getColumn
(
$name
)
->
typecast
(
$value
));
if
(
$schema
->
getColumn
(
$name
)
!==
null
)
{
$record
->
setAttribute
(
$name
,
$schema
->
getColumn
(
$name
)
->
typecast
(
$value
));
}
else
{
$record
->
setAttribute
(
$name
,
$value
);
}
}
else
{
}
else
{
$record
->
$name
=
$value
;
$record
->
$name
=
$value
;
}
}
...
...
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