This commit is contained in:
2026-02-17 14:56:23 +01:00
commit 68f7a95fdf
695 changed files with 154611 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
<?php
namespace DynCom\mysyde\common\traits;
use DynCom\mysyde\common\classes\Form;
/**
* Created by PhpStorm.
* User: Michael Bauer
* Date: 7/13/2015
* Time: 7:22 PM
*/
trait genericViewModelTrait
{
use arrayGettableTrait;
/**
* @return bool
*/
public function allFormsValid() {
$arr = $this->getAllFieldsAsArray();
foreach($arr as $fieldName => $fieldValue) {
if($fieldValue instanceof Form) {
$fieldValue->validateRequestAgainstRules();
if (!$fieldValue->isRequestValid()) {
return false;
}
}
}
return true;
}
}