Skip to content
Permalink
Browse files

Rename method.

I think extractOriginalChanged() makes more sense than OriginalDirty
did. I considered calling the method extractUntouched() at Lorenzo's
suggestion, but the method gets properties that have been touched.

Refs #6467
  • Loading branch information...
markstory committed May 6, 2015
1 parent 7ad3ee6 commit 25da94645c8643ce09585c20c13e97b8aa4ffeb1
@@ -528,7 +528,7 @@ public function extract(array $properties, $onlyDirty = false)
* Returns an array with the requested original properties
* stored in this entity, indexed by property name.
*
* Properties that have not changed will be included in the
* Properties that have are unchanged changed will be included in the

This comment has been minimized.

Copy link
@antograssiot

antograssiot May 6, 2015

Member

something weird in this sentence...

* return of this method.
*
* @param array $properties List of properties to be returned
@@ -550,13 +550,13 @@ public function extractOriginal(array $properties)
* Returns an array with only the original properties
* stored in this entity, indexed by property name.
*
* This method will only return properties that have been modified.
* Unchanged properties will be omited.
* This method will only return properties that have been modified since
* the entity was built unchanged properties will be omitted.
*
* @param array $properties List of properties to be returned
* @return array
*/
public function extractOriginalDirty(array $properties)
public function extractOriginalChanged(array $properties)
{
$result = [];
foreach ($properties as $property) {
@@ -138,7 +138,7 @@ protected function _processAssociation(Event $event, Entity $entity, Association
$countConditions = $entity->extract($foreignKeys);
$updateConditions = array_combine($primaryKeys, $countConditions);
$countOriginalConditions = $entity->extractOriginalDirty($foreignKeys);
$countOriginalConditions = $entity->extractOriginalChanged($foreignKeys);
if ($countOriginalConditions !== []) {
$updateOriginalConditions = array_combine($primaryKeys, $countOriginalConditions);
}
@@ -92,7 +92,7 @@ public function testExtractOriginal()
];
$this->assertEquals($expected, $result);
$result = $entity->extractOriginalDirty(['id', 'title', 'body']);
$result = $entity->extractOriginalChanged(['id', 'title', 'body']);
$expected = [
'body' => 'no',
];

0 comments on commit 25da946

Please sign in to comment.
You can’t perform that action at this time.