diff --git a/src/ORM/Behavior/TranslateBehavior.php b/src/ORM/Behavior/TranslateBehavior.php index 13b947c5c0e..2b89d4eff2a 100644 --- a/src/ORM/Behavior/TranslateBehavior.php +++ b/src/ORM/Behavior/TranslateBehavior.php @@ -335,7 +335,7 @@ public function afterSave(Event $event, EntityInterface $entity) * * {@inheritDoc} */ - public function buildMarhshalMap($marshaller, $map, $options) + public function buildMarshalMap($marshaller, $map, $options) { if (isset($options['translations']) && !$options['translations']) { return []; diff --git a/src/ORM/Marshaller.php b/src/ORM/Marshaller.php index ade2dfdf475..01982ccb125 100644 --- a/src/ORM/Marshaller.php +++ b/src/ORM/Marshaller.php @@ -122,7 +122,7 @@ protected function _buildPropertyMap($data, $options) foreach ($behaviors->loaded() as $name) { $behavior = $behaviors->get($name); if ($behavior instanceof PropertyMarshalInterface) { - $map += $behavior->buildMarhshalMap($this, $map, $options); + $map += $behavior->buildMarshalMap($this, $map, $options); } } diff --git a/src/ORM/PropertyMarshalInterface.php b/src/ORM/PropertyMarshalInterface.php index 34a4190d31e..a5567c710a8 100644 --- a/src/ORM/PropertyMarshalInterface.php +++ b/src/ORM/PropertyMarshalInterface.php @@ -30,5 +30,5 @@ interface PropertyMarshalInterface * @param array $options The options array used in the marshalling call. * @return array A map of `[property => callable]` of additional properties to marshal. */ - public function buildMarhshalMap($marshaller, $map, $options); + public function buildMarshalMap($marshaller, $map, $options); } diff --git a/tests/TestCase/ORM/Behavior/TranslateBehaviorTest.php b/tests/TestCase/ORM/Behavior/TranslateBehaviorTest.php index 705ccff59c6..fc16a1a4e94 100644 --- a/tests/TestCase/ORM/Behavior/TranslateBehaviorTest.php +++ b/tests/TestCase/ORM/Behavior/TranslateBehaviorTest.php @@ -1198,7 +1198,7 @@ public function testBuildMarshalMapTranslationsOff() $marshaller = $table->marshaller(); $translate = $table->behaviors()->get('Translate'); - $result = $translate->buildMarhshalMap($marshaller, [], ['translations' => false]); + $result = $translate->buildMarshalMap($marshaller, [], ['translations' => false]); $this->assertSame([], $result); } @@ -1214,11 +1214,11 @@ public function testBuildMarshalMapTranslationsOn() $marshaller = $table->marshaller(); $translate = $table->behaviors()->get('Translate'); - $result = $translate->buildMarhshalMap($marshaller, [], ['translations' => true]); + $result = $translate->buildMarshalMap($marshaller, [], ['translations' => true]); $this->assertArrayHasKey('_translations', $result); $this->assertInstanceOf('Closure', $result['_translations']); - $result = $translate->buildMarhshalMap($marshaller, [], []); + $result = $translate->buildMarshalMap($marshaller, [], []); $this->assertArrayHasKey('_translations', $result); $this->assertInstanceOf('Closure', $result['_translations']); } @@ -1234,7 +1234,7 @@ public function testBuildMarshalMapNonArrayData() $table->addBehavior('Translate', ['fields' => ['title', 'body']]); $translate = $table->behaviors()->get('Translate'); - $map = $translate->buildMarhshalMap($table->marshaller(), [], []); + $map = $translate->buildMarshalMap($table->marshaller(), [], []); $entity = $table->newEntity(); $result = $map['_translations']('garbage', $entity); $this->assertNull($result, 'Non-array should not error out.'); @@ -1253,7 +1253,7 @@ public function testBuildMarshalMapBuildEntities() $table->addBehavior('Translate', ['fields' => ['title', 'body']]); $translate = $table->behaviors()->get('Translate'); - $map = $translate->buildMarhshalMap($table->marshaller(), [], []); + $map = $translate->buildMarshalMap($table->marshaller(), [], []); $entity = $table->newEntity(); $data = [ 'en' => [ @@ -1291,7 +1291,7 @@ public function testBuildMarshalMapBuildEntitiesValidationErrors() $translate = $table->behaviors()->get('Translate'); $entity = $table->newEntity(); - $map = $translate->buildMarhshalMap($table->marshaller(), [], []); + $map = $translate->buildMarshalMap($table->marshaller(), [], []); $data = [ 'en' => [ 'title' => 'English Title', @@ -1335,7 +1335,7 @@ public function testBuildMarshalMapUpdateExistingEntities() 'es' => $es, 'en' => $en, ]); - $map = $translate->buildMarhshalMap($table->marshaller(), [], []); + $map = $translate->buildMarshalMap($table->marshaller(), [], []); $data = [ 'en' => [ 'title' => 'English Title', @@ -1380,7 +1380,7 @@ public function testBuildMarshalMapUpdateEntitiesValidationErrors() 'es' => $es, 'en' => $en, ]); - $map = $translate->buildMarhshalMap($table->marshaller(), [], []); + $map = $translate->buildMarshalMap($table->marshaller(), [], []); $data = [ 'en' => [ 'title' => 'English Title',