symphonycms/symphony-2 — pull request #2088 by nilshoerrmann (2014-06-10 13:21:32+00:00)
Title: Associations Interfaces

This pull request introduces the concept of association interfaces to the Symphony core. It doesn't add interfaces itself but it offers extensions a standardised way to do so. In the extension driver, developers can now define the following:

```php
public static function registerProviders()
{
self::$provides = array(
'association-interface' => array(
'handle' => 'Name'
)
'association-editor' => array(
'handle' => 'Name'
)
);

return true;
}
```

Association interfaces are meant to enhance the way associations are displayed to the user.
Association editors are meant to provide a way to manipulate the related data itself.

Interface and editor settings are stored globally in `tbl_sections_associations` and associative fields can make use of a widget function to provide a selection in the section editor:

```php
$this->appendAssociationInterfaceSelect($wrapper);
```

The association information stored in the database will be automatically added to all associative field instances, e. g.:

```html

…

```

Additionally all association data is provided in the Symphony JavaScript object via `Symphony.Context.get('env')`.