<?php
/**
 * Created by PhpStorm.
 * User: John Abuedo
 * Date: 9/26/2015
 * Time: 6:39 AM
 */

namespace MediaProfile\View\Helper;
use Zend\Db\Adapter\Adapter;
use Zend\View\Helper\AbstractHelper;



class Testhelper extends AbstractHelper
{
    protected $adapter;

    public function __construct(Adapter $dbAdapter)
    {
        $this->adapter = $dbAdapter;
    }

    public function __invoke($id)
    {
        $dbAdapter = $this->adapter;
        $statement = $dbAdapter->query("SELECT position_name FROM positions WHERE positions_id = $id",  Adapter::QUERY_MODE_EXECUTE);
        $result = $statement->execute();

        foreach($result as $key => $value){
            $arVal = $value;
            implode(" ", $arVal);
        }

        return implode(" ", $arVal);
    }
}