Commit 2880ebeb authored by Tino Goratsch's avatar Tino Goratsch

- use the DataProcessor for the AbstractNestedSetModel too

- minor changes
parent d45177fb
......@@ -54,18 +54,18 @@ abstract class AbstractModel
*/
protected function save(array $data, $entryId = null)
{
$this->dispatchBeforeSaveEvent($this->repository, $data, $entryId);
$data = $this->prepareData($data);
if (intval($entryId)) {
$result = $this->repository->update($data, $entryId);
} else {
$this->dispatchBeforeSaveEvent($this->repository, $data, $entryId);
if ($entryId === null) {
$result = $this->repository->insert($data);
if ($result !== false) {
$entryId = $result;
}
} else {
$result = $this->repository->update($data, $entryId);
}
$this->dispatchAfterSaveEvent($this->repository, $data, $entryId);
......
......@@ -59,6 +59,8 @@ abstract class AbstractNestedSetModel extends AbstractModel
*/
protected function save(array $data, $entryId = null)
{
$data = $this->prepareData($data);
$this->dispatchBeforeSaveEvent($this->repository, $data, $entryId);
if ($entryId === null) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment