public function render()
{
$haystack = $this->arguments['haystack'];
if (null === $haystack) {
$haystack = $this->renderChildren();
}
if (false === is_array($haystack) && false === $haystack instanceof \Iterator && null !== $haystack) {
throw new Exception('Invalid argument supplied to Iterator/FirstViewHelper - expected array, Iterator or NULL but got ' . gettype($haystack), 1351958398);
}
if (null === $haystack) {
return null;
}
foreach ($haystack as $needle) {
return $needle;
}
return null;
}