This commit is contained in:
Oliver Davies 2017-11-02 07:40:34 +00:00
parent cb9b98d86d
commit 933c37625e
2 changed files with 9 additions and 4 deletions

View file

@ -4,4 +4,6 @@ namespace FormatTalksBundle;
use Symfony\Component\HttpKernel\Bundle\Bundle; use Symfony\Component\HttpKernel\Bundle\Bundle;
class SculpinFormatTalksBundle extends Bundle {} class SculpinFormatTalksBundle extends Bundle
{
}

View file

@ -39,7 +39,8 @@ class FormatTalksExtension extends Twig_Extension
* *
* @return array * @return array
*/ */
public function getAll(array $data) { public function getAll(array $data)
{
return $this->sort($this->format($data)); return $this->sort($this->format($data));
} }
@ -52,7 +53,8 @@ class FormatTalksExtension extends Twig_Extension
* *
* @return array * @return array
*/ */
public function getUpcoming(array $data) { public function getUpcoming(array $data)
{
return $this->sort($this->format($data)->filter(function ($talk) { return $this->sort($this->format($data)->filter(function ($talk) {
return $talk['event']['date'] >= $this->today; return $talk['event']['date'] >= $this->today;
})); }));
@ -67,7 +69,8 @@ class FormatTalksExtension extends Twig_Extension
* *
* @return array * @return array
*/ */
public function getPast(array $data) { public function getPast(array $data)
{
return $this->sort($this->format($data)->filter(function ($talk) { return $this->sort($this->format($data)->filter(function ($talk) {
return $talk['event']['date'] < $this->today; return $talk['event']['date'] < $this->today;
})); }));