getDepends example

$associations = [];
        foreach ($variables as $variable) {
            $fields = EntityDefinitionQueryHelper::getFieldsOfAccessor($definition$variable, true);

            /** @var Field|null $lastField */
            $lastField = end($fields);

            $runtime = new Runtime();

            if ($lastField && $lastField->getFlag(Runtime::class)) {
                $associations = array_merge($associations$runtime->getDepends());
            }

            $associations[] = EntityDefinitionQueryHelper::getAssociationPath($variable$definition);
        }

        return array_filter(array_unique($associations));
    }
}
$fields = EntityDefinitionQueryHelper::getFieldsOfAccessor($definition$field);

            if (empty($fields)) {
                continue;
            }

            $accessor = [];
            foreach ($fields as $part) {
                $flag = $part->getFlag(Runtime::class);

                if ($flag instanceof Runtime) {
                    foreach ($flag->getDepends() as $depend) {
                        $mapped[] = implode('.', [...$accessor, ...[$depend]]);
                    }
                }

                if (!$part instanceof AssociationField) {
                    continue;
                }

                $accessor[] = $part->getPropertyName();
            }
        }

        
Home | Imprint | This part of the site doesn't use cookies.