Improve names for all meta methods
[MAILPOET-4966]
This commit is contained in:
@@ -66,7 +66,7 @@ class UpdateAutomationController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$automation->deleteMetas();
|
$automation->deleteAllMetas();
|
||||||
if (array_key_exists('meta', $data)) {
|
if (array_key_exists('meta', $data)) {
|
||||||
foreach ($data['meta'] as $key => $value) {
|
foreach ($data['meta'] as $key => $value) {
|
||||||
$automation->setMeta($key, $value);
|
$automation->setMeta($key, $value);
|
||||||
|
@@ -190,7 +190,7 @@ class Automation {
|
|||||||
return $this->meta[$key] ?? null;
|
return $this->meta[$key] ?? null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getMetas(): array {
|
public function getAllMetas(): array {
|
||||||
return $this->meta;
|
return $this->meta;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -209,7 +209,7 @@ class Automation {
|
|||||||
$this->setUpdatedAt();
|
$this->setUpdatedAt();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function deleteMetas(): void {
|
public function deleteAllMetas(): void {
|
||||||
$this->meta = [];
|
$this->meta = [];
|
||||||
$this->setUpdatedAt();
|
$this->setUpdatedAt();
|
||||||
}
|
}
|
||||||
|
@@ -52,7 +52,7 @@ class AutomationMapper {
|
|||||||
}, $step->getNextSteps()),
|
}, $step->getNextSteps()),
|
||||||
];
|
];
|
||||||
}, $automation->getSteps()),
|
}, $automation->getSteps()),
|
||||||
'meta' => (object)$automation->getMetas(),
|
'meta' => (object)$automation->getAllMetas(),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -19,7 +19,7 @@ class AutomationTest extends \MailPoetTest {
|
|||||||
|
|
||||||
$automation->setMeta('foo', 'bar');
|
$automation->setMeta('foo', 'bar');
|
||||||
$this->assertEquals('bar', $automation->getMeta('foo'));
|
$this->assertEquals('bar', $automation->getMeta('foo'));
|
||||||
$this->assertEquals(['foo' => 'bar'], $automation->getMetas());
|
$this->assertEquals(['foo' => 'bar'], $automation->getAllMetas());
|
||||||
$this->storage->updateAutomation($automation);
|
$this->storage->updateAutomation($automation);
|
||||||
|
|
||||||
$storedAutomation = $this->storage->getAutomation($automation->getId());
|
$storedAutomation = $this->storage->getAutomation($automation->getId());
|
||||||
@@ -41,8 +41,8 @@ class AutomationTest extends \MailPoetTest {
|
|||||||
|
|
||||||
$automation->setMeta('foo', 'bar');
|
$automation->setMeta('foo', 'bar');
|
||||||
$automation->setMeta('bar', 'baz');
|
$automation->setMeta('bar', 'baz');
|
||||||
$automation->deleteMetas();
|
$automation->deleteAllMetas();
|
||||||
$this->assertEmpty($automation->getMetas());
|
$this->assertEmpty($automation->getAllMetas());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testAutomationComparisonWorks() {
|
public function testAutomationComparisonWorks() {
|
||||||
|
Reference in New Issue
Block a user