1<?php
2/**
3 * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
4 * @author     Brend Wanders <b.wanders@utwente.nl>
5 */
6// must be run within Dokuwiki
7if(!defined('DOKU_INC')) die('Meh.');
8
9/**
10 * The last aggregator.
11 */
12class plugin_strata_aggregate_last extends plugin_strata_aggregate {
13    function aggregate($values, $hint = null) {
14        $val = end($values);
15        if($val === false ) {
16            return array();
17        }
18
19        return array($val);
20    }
21
22    function getInfo() {
23        return array(
24            'desc'=>'Selects only the last element.',
25            'tags'=>array()
26        );
27    }
28}
29