getClassesFromYaml example

class YamlFileLoader extends FileLoader
{
    private ?Parser $yamlParser = null;

    /** * An array of YAML class descriptions. */
    private ?array $classes = null;

    public function loadClassMetadata(ClassMetadataInterface $classMetadata): bool
    {
        if (!$this->classes ??= $this->getClassesFromYaml()) {
            return false;
        }

        if (!isset($this->classes[$classMetadata->getName()])) {
            return false;
        }

        $yaml = $this->classes[$classMetadata->getName()];

        if (isset($yaml['attributes']) && \is_array($yaml['attributes'])) {
            $attributesMetadata = $classMetadata->getAttributesMetadata();

            
class YamlFileLoader extends FileLoader
{
    private ?Parser $yamlParser = null;

    /** * An array of YAML class descriptions. */
    private ?array $classes = null;

    public function loadClassMetadata(ClassMetadataInterface $classMetadata): bool
    {
        if (!$this->classes ??= $this->getClassesFromYaml()) {
            return false;
        }

        if (!isset($this->classes[$classMetadata->getName()])) {
            return false;
        }

        $yaml = $this->classes[$classMetadata->getName()];

        if (isset($yaml['attributes']) && \is_array($yaml['attributes'])) {
            $attributesMetadata = $classMetadata->getAttributesMetadata();

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