for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* This file is part of riesenia/pohoda package.
*
* Licensed under the MIT License
* (c) RIESENIA.com
*/
declare(strict_types=1);
namespace Riesenia\Pohoda\Stock;
use Riesenia\Pohoda\AbstractAgenda;
use Riesenia\Pohoda\Common\OptionsResolver;
class Category extends AbstractAgenda
{
* {@inheritdoc}
public function getXML(): \SimpleXMLElement
$category = $this->data['idCategory'] ?? null;
return $this->createXML()->addChild(
'stk:idCategory',
is_null($category) ? null : strval($category),
$this->namespace('stk'),
);
}
protected function configureOptions(OptionsResolver $resolver): void
// available options
$resolver->setDefined(['idCategory']);
// validate / format options
$resolver->setRequired('idCategory');
$resolver->setNormalizer('idCategory', $this->normalizerFactory->getClosure('int'));