Doctrine\ODM\PHPCR\Mapping\Driver\XmlDriver::getCascadeMode PHP Метод

getCascadeMode() приватный Метод

Gathers a list of cascade options found in the given cascade element.
private getCascadeMode ( SimpleXMLElement $cascadeElement ) : integer
$cascadeElement SimpleXMLElement cascade element.
Результат integer a bitmask of cascade options.
    private function getCascadeMode(SimpleXMLElement $cascadeElement)
    {
        $cascade = 0;
        foreach ($cascadeElement->children() as $action) {
            // According to the JPA specifications, XML uses "cascade-persist"
            // instead of "persist". Here, both variations
            // are supported because both YAML and Annotation use "persist"
            // and we want to make sure that this driver doesn't need to know
            // anything about the supported cascading actions
            $cascadeMode = str_replace('cascade-', '', $action->getName());
            $constantName = 'Doctrine\\ODM\\PHPCR\\Mapping\\ClassMetadata::CASCADE_' . strtoupper($cascadeMode);
            if (!defined($constantName)) {
                throw new MappingException("Cascade mode '{$cascadeMode}' not supported.");
            }
            $cascade |= constant($constantName);
        }
        return $cascade;
    }