19declare(strict_types=1);
53 $this->subtype =
null;
54 $this->version =
null;
66 $schema_info = $this->schema_folder->getByVersionOrLatest(
71 return is_null($schema_info)
73 : $this->xsd_file_factory->handler()->withFileInfo($schema_info->getFile());
84 $schema_info = $this->schema_folder->getLatest(
88 return is_null($schema_info)
90 : $this->xsd_file_factory->handler()->withFileInfo($schema_info->getFile());
102 $schema_info = $this->schema_folder->getByVersion(
107 return !is_null($schema_info);
111 XMLFileNodeInfoInterface $xml_file_node_info
113 $type_str = $xml_file_node_info->getValueOfAttribute(
'Entity');
114 $types = str_contains($type_str,
'_')
115 ? explode(
'_', $type_str)
117 $version_str = $xml_file_node_info->hasAttribute(
'SchemaVersion')
118 ? $xml_file_node_info->getValueOfAttribute(
'SchemaVersion')
120 if ($version_str ===
'') {
122 ->withType($types[0])
123 ->withSubType($types[1])
127 ->withType($types[0])
128 ->withSubType($types[1])
129 ->withVersion($this->data_factory->version($version_str));
135 $clone = clone $this;
136 $clone->type = $type;
143 $clone = clone $this;
144 $clone->subtype = $subtype;
151 $clone = clone $this;
158 if (is_null($this->getVersion()) || is_null($this->getVersion()->getMajor())) {
161 return $this->getVersion()->getMajor() .
".0.0";
176 return $this->subtype;
181 if (is_null($this->getPrimaryType())) {
184 if (is_null($this->getSecondaryType())) {
185 return $this->getPrimaryType();
187 return $this->getPrimaryType() .
'_' . $this->getSecondaryType();
A version number that consists of three numbers (major, minor, patch).
withSubType(string $subtype)
DataFactory $data_factory
withInformationOf(XMLFileNodeInfoInterface $xml_file_node_info)
__construct(SchemaFolderInterface $schema_folder, DataFactory $data_factory, ParserFactoryInterface $parser_factory, XSDFileFactoryInterface $xsd_file_factory)
doesXSDFileWithMatchingVersionExist()
ParserFactoryInterface $parser_factory
SchemaFolderInterface $schema_folder
withVersion(Version $version)
getXSDFileHandlerLatest()
XSDFileFactoryInterface $xsd_file_factory
getXSDFileHandlerByVersionOrLatest()
const ILIAS_VERSION_NUMERIC