errorFlowCreateFromXmlFile example

Feature::triggerDeprecationOrThrow(
                'v6.6.0.0',
                'The flow-action.xml is deprecated and will be removed in v6.6.0.0. Use flow.xml instead.'
            );
        } else {
            $schemaFile = \dirname(__FILE__, 2) . self::XSD_FLOW_FILE;
        }

        try {
            $doc = XmlUtils::loadFile($xmlFile$schemaFile);
        } catch (\Exception $e) {
            throw AppException::errorFlowCreateFromXmlFile($xmlFile$e->getMessage());
        }

        $actions = $doc->getElementsByTagName('flow-actions')->item(0);
        $actions = $actions === null ? null : Actions::fromXml($actions);

        return new self(\dirname($xmlFile)$actions);
    }

    public function getPath(): string
    {
        return $this->path;
    }
private string $path,
        private readonly CustomEvents|null $customEvents
    ) {
    }

    public static function createFromXmlFile(string $xmlFile): self
    {
        try {
            $schemaFile = \dirname(__FILE__, 2) . self::XSD_FILE;
            $doc = XmlUtils::loadFile($xmlFile$schemaFile);
        } catch (\Exception $e) {
            throw AppException::errorFlowCreateFromXmlFile($xmlFile$e->getMessage());
        }

        $customEvents = $doc->getElementsByTagName('flow-events')->item(0);
        $customEvents = $customEvents === null ? null : CustomEvents::fromXml($customEvents);

        return new self(\dirname($xmlFile)$customEvents);
    }

    public function getPath(): string
    {
        return $this->path;
    }
Home | Imprint | This part of the site doesn't use cookies.