<?php
namespace App\ImportedDocument; abstract class EntityAbstract { abstract protected function validateEntityFields(\App\MessagesCollector $messagesCollector); public function check() { $msgs = new \App\MessagesCollector(); $this->validateEntityFields($msgs); if ($msgs->hasErrorOrWarning()) { throw new \App\MessagesException($msgs); } return $msgs; } } 