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
c56bf509
Commit
c56bf509
authored
Feb 18, 2014
by
Alexander Mohorev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
small typos
parent
8f9c54a1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
9 deletions
+5
-9
ActiveRecord.php
extensions/mongodb/ActiveRecord.php
+5
-9
No files found.
extensions/mongodb/ActiveRecord.php
View file @
c56bf509
...
...
@@ -37,7 +37,7 @@ abstract class ActiveRecord extends BaseActiveRecord
* For example, to change the status to be 1 for all customers whose status is 2:
*
* ~~~
* Customer::updateAll(['status' => 1], ['status' = 2]);
* Customer::updateAll(['status' => 1], ['status' =
>
2]);
* ~~~
*
* @param array $attributes attribute values (name-value pairs) to be saved into the collection
...
...
@@ -78,7 +78,7 @@ abstract class ActiveRecord extends BaseActiveRecord
* For example, to delete all customers whose status is 3:
*
* ~~~
* Customer::deleteAll(
'status = 3'
);
* Customer::deleteAll(
['status' => 3]
);
* ~~~
*
* @param array $condition description of the objects to delete.
...
...
@@ -88,10 +88,6 @@ abstract class ActiveRecord extends BaseActiveRecord
*/
public
static
function
deleteAll
(
$condition
=
[],
$options
=
[])
{
$options
[
'w'
]
=
1
;
if
(
!
array_key_exists
(
'multiple'
,
$options
))
{
$options
[
'multiple'
]
=
true
;
}
return
static
::
getCollection
()
->
remove
(
$condition
,
$options
);
}
...
...
@@ -237,8 +233,7 @@ abstract class ActiveRecord extends BaseActiveRecord
$values
[
$key
]
=
isset
(
$currentAttributes
[
$key
])
?
$currentAttributes
[
$key
]
:
null
;
}
}
$collection
=
static
::
getCollection
();
$newId
=
$collection
->
insert
(
$values
);
$newId
=
static
::
getCollection
()
->
insert
(
$values
);
$this
->
setAttribute
(
'_id'
,
$newId
);
foreach
(
$values
as
$name
=>
$value
)
{
$this
->
setOldAttribute
(
$name
,
$value
);
...
...
@@ -348,4 +343,4 @@ abstract class ActiveRecord extends BaseActiveRecord
}
return
$this
->
collectionName
()
===
$record
->
collectionName
()
&&
(
string
)
$this
->
getPrimaryKey
()
===
(
string
)
$record
->
getPrimaryKey
();
}
}
}
\ No newline at end of file
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