title: How to add custom property to Symfony Doctrine YAML mapping file
body: <p>Can anyone tell me how to add custom property to doctrine ORM yml file?</p>
  
  <p>My idea is to add a property like this:</p>
  
  <pre><code>fields:
      name:
          type: string
          localizable: true
  </code></pre>
  
  <p>Then I would like to get information about this <strong>localizable</strong> property by using</p>
  
  <pre><code>protected function getEntityMetadata($entity)
  {
      $factory = new DisconnectedMetadataFactory($this-&gt;getContainer()-&gt;get('doctrine'));
  
      return $factory-&gt;getClassMetadata($entity)-&gt;getMetadata();
  }
  </code></pre>
  
  <p>and then:</p>
  
  <pre><code>    $met    = $this-&gt;getEntityMetadata($bundle.'\\Entity\\'.$entity);
      $this-&gt;metadata = $met[0];
      $fields = $this-&gt;metadata-&gt;fieldMappings;
  
      if (isset($fields)) {
  
          foreach ($fields as $field =&gt; $fieldMapping) {
              if (isset($fieldMapping['localizable']) &amp;&amp; $fieldMapping['localizable'] == true) {
  
                  // Do sth with it
              }
          }
      }
  </code></pre>