symphonists / uniondatasource

A union datasources allows you to combine multiple datasources to output a single datasource for the primary purpose of a unified pagination.
13 stars 11 forks source link

DataSourceEntriesBuilt #2

Closed nilshoerrmann closed 13 years ago

nilshoerrmann commented 13 years ago

It would be great if the UnionDatasource could implement the DataSourceEntriesBuilt delegate present in the Symphony core. Otherwise the next version of Subsection Manager will fail to output its items.

brendo commented 13 years ago

I've added the delegate, keep in mind that the values you'll get back are slightly different to what you might be expecting.

$this refers to the Union Datasource, not one of the 'other' datasources that it's unioning. So if you are joining 3 datasources, this delegate will only fire once.

$entries may contain entries from multiple sections, instead of the same section as the datasource.

$filters refers to the filters on the Union Datasource, which should be always an empty array (as Union DS doesn't do any filtering)

You can access all the datasource objects via $this->datasources, which is an associative array of datasource-handle => Datasource objects used in the Union DS.