Display form only if it is enabled
[MAILPOET-3075]
This commit is contained in:
@ -118,6 +118,13 @@ class FormEntity {
|
|||||||
$this->styles = $styles;
|
$this->styles = $styles;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string $status
|
||||||
|
*/
|
||||||
|
public function setStatus(string $status) {
|
||||||
|
$this->status = $status;
|
||||||
|
}
|
||||||
|
|
||||||
public function toArray(): array {
|
public function toArray(): array {
|
||||||
return [
|
return [
|
||||||
'id' => $this->getId(),
|
'id' => $this->getId(),
|
||||||
|
@ -109,7 +109,10 @@ class DisplayFormInWPContent {
|
|||||||
* @return array<string, FormEntity>
|
* @return array<string, FormEntity>
|
||||||
*/
|
*/
|
||||||
private function getForms(): array {
|
private function getForms(): array {
|
||||||
$forms = $this->formsRepository->findBy(['deletedAt' => null], ['updatedAt' => 'ASC']);
|
$forms = $this->formsRepository->findBy([
|
||||||
|
'deletedAt' => null,
|
||||||
|
'status' => FormEntity::STATUS_ENABLED,
|
||||||
|
], ['updatedAt' => 'ASC']);
|
||||||
$forms = $this->filterOneFormInEachDisplayType($forms);
|
$forms = $this->filterOneFormInEachDisplayType($forms);
|
||||||
return $forms;
|
return $forms;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user