Skip to content

Metadata

Mitchell van Wijngaarden edited this page May 10, 2014 · 1 revision

This is needed for Doctrine's entity mapping. If you have a field private $name on your entity, the metadata will tell Doctrine what it needs to know about this. Like type and such. Since this package currently only supports annotations the following examples will use this format.

<?php

/**
 * @Entity
 * @Table(name="users")
 */
class Article
{
    /**
     * @Column(name="heading_title", type="string", nullable=true)
     */
    private $title;
}

In this example the Article class is an entity that makes use of the database table users. The title is mapped to be a string (VARCHAR) with the column name heading_title (just for example) and nullable.

For this configuration option you'll need to point to the directory where your metadata file(s) are located, since annotations are used you want to point to your entities. This can be one or more locations.

Default: [base_path('app/models')]

'metadata' => [
    base_path('src/Accounts'),
    base_path('src/Pages')
],