Compare commits

...

7 Commits

Author SHA1 Message Date
da2801560d
iterate in $data until fields for empty relation are over
All checks were successful
soko-web/pipeline/pr-master This commit looks good
2023-05-28 15:47:35 +02:00
dd855a6d6b
Merge pull request 'fix the case when relation is set to null' (#21) from bugfix/fix-when-relation-is-set-to-null into master
All checks were successful
soko-web/pipeline/head This commit looks good
Reviewed-on: #21
2023-05-28 15:47:27 +02:00
25548176bb
fix the case when relation is set to null
All checks were successful
soko-web/pipeline/pr-master This commit looks good
2023-05-28 15:46:13 +02:00
f31b801c03
Merge pull request 'generated unique slug should be part of diff' (#20) from bugfix/generated-unique-slug-should-be-part-of-diff into master
All checks were successful
soko-web/pipeline/head This commit looks good
Reviewed-on: #20
2023-05-28 15:45:58 +02:00
346b1a0ca9
generated unique slug should be part of diff
All checks were successful
soko-web/pipeline/pr-master This commit looks good
2023-05-28 15:45:19 +02:00
6fdd25ae4b
Merge pull request 'MAPG-238 include view with @include' (#19) from feature/MAPG-238-include-possibility-for-templating-engine into master
All checks were successful
soko-web/pipeline/head This commit looks good
Reviewed-on: #19
2023-05-28 15:45:10 +02:00
754a23706a
MAPG-238 include view with @include
All checks were successful
soko-web/pipeline/pr-master This commit looks good
2023-05-27 10:56:20 +02:00
2 changed files with 13 additions and 3 deletions

View File

@ -115,7 +115,7 @@ class PersistentDataManager implements IPersistentDataManager
if (count($modified) > 0) {
if ($model instanceof ModelWithSlug && isset($modified['slug'])) {
$modified['slug'] = $this->generateUniqueSlug($model, $modified['slug']);
$diff['slug']['new'] = $modified['slug'] = $this->generateUniqueSlug($model, $modified['slug']);
}
$modify->setId($id);
@ -278,7 +278,10 @@ class PersistentDataManager implements IPersistentDataManager
$method = 'set' . str_replace('_', '', ucwords($relation, '_'));
$model->$method($relationModel);
} else {
next($data);
while (substr($key, 0, strlen($relation . '__')) === $relation . '__') {
next($data);
$key = key($data);
}
}
next($relations);
@ -302,6 +305,8 @@ class PersistentDataManager implements IPersistentDataManager
if ($relationModel !== null) {
$model->$methodSet($relationModel->getId());
} else {
$model->$methodSet(null);
}
}
}

View File

@ -97,7 +97,12 @@ class Linker
fwrite($outputFileHandle, $extra[0]);
while (($line = fgets($inputFileHandle)) !== false) {
fwrite($outputFileHandle, $line);
if (preg_match('/^\s*@include\((.*)\)\s*$/', $line, $matches) === 1) {
$include = file_get_contents(ROOT . '/views/' . $matches[1] . '.php');
fwrite($outputFileHandle, $include);
} else {
fwrite($outputFileHandle, $line);
}
}
fwrite($outputFileHandle, $extra[1]);