. */ namespace SP\Modules\Web\Forms; use SP\Config\Config; use SP\Config\ConfigData; use SP\Core\Context\ContextInterface; use SP\Core\Context\SessionContext; use SP\Core\Dic\InjectableTrait; /** * Class FormBase * * @package SP\Modules\Web\Forms */ abstract class FormBase { use InjectableTrait; /** * @var int */ protected $itemId; /** * @var Config */ protected $config; /** * @var ConfigData */ protected $configData; /** * @var SessionContext */ protected $context; /** * FormBase constructor. * * @param $itemId * @throws \SP\Core\Dic\ContainerException */ public function __construct($itemId = null) { $this->injectDependencies(); $this->itemId = $itemId; } /** * @param Config $config * @param ContextInterface $session */ public function inject(Config $config, ContextInterface $session) { $this->config = $config; $this->configData = $config->getConfigData(); $this->context = $session; } /** * Analizar los datos de la petición HTTP * * @return void */ abstract protected function analyzeRequestData(); }