-
Notifications
You must be signed in to change notification settings - Fork 0
/
Projects.php
34 lines (29 loc) · 879 Bytes
/
Projects.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
/*
* This file is a part of Sculpin.
*
* (c) Dragonfly Development Inc.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Mavimo\Sculpin\Bundle\ProjectsBundle;
use Sculpin\Contrib\ProxySourceCollection\ProxySourceCollection;
/**
* Projects Collection.
*
* @author Marco Vito Moscaritolo <marco@mavimo.org>
* @author Beau Simensen <beau@dflydev.com>
*/
class Projects extends ProxySourceCollection
{
public function init()
{
// We have special sorting rules for our items based on the date
// and title. This assumes that the items are actually Project instances.
uasort($this->items, function ($a, $b) {
return strnatcmp($b->date().' '.$b->title(), $a->date().' '.$a->title());
});
parent::init();
}
}