Funkcja w kontrolerze wygląda tak:
public function getCost($idi, $em_mysql) {
$query_mysql_koszt = $em_mysql->createQuery("select p.id from BbKosztBundle:Slownik_kosztow p ");
if (count($query_mysql_koszt->getResult()) > 0
) { for ($k = 0; $k < count($result_mysql_koszt); $k++) { $koszt_array[$k]['nazwa'] = $result_mysql_koszt[$k]['nazwa'];
$koszt_array[$k]['nazwa'] = $k+1;
$koszt_array[$k]['id'] = $result_mysql_koszt[$k]['id'];
}
}
return count($query_mysql_koszt->getResult());// $koszt_array; }
natomiast plik jest tutaj:

Tutaj plik w Entity:
<?php
namespace Bb\KosztBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* Slownik_kosztow
*
* @ORM\Table(name="slownik_kosztow")
* @ORM\Entity
*/
class Slownik_kosztow
{
/**
* @var integer
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @var integer
*
* @ORM\Column(name="idi", type="integer", nullable=true)
*/
private $idi;
/**
* @var string
*
* @ORM\Column(name="nazwa", type="string", length=80, nullable=false)
*/
private $nazwa;
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* Set idi
*
* @param integer $idi
*
* @return slownik_kosztow
*/
public function setIdi($idi)
{
$this->idi = $idi;
return $this;
}
/**
* Get idi
*
* @return integer
*/
public function getIdi()
{
return $this->idi;
}
/**
* Set nazwa
*
* @param string $nazwa
*
* @return slownik_kosztow
*/
public function setNazwa($nazwa)
{
$this->nazwa = $nazwa;
return $this;
}
/**
* Get nazwa
*
* @return string
*/
public function getNazwa()
{
return $this->nazwa;
}
}
Dodatkowo jest tak, że jak na serwer wyślę folder config to po odświeżeniu widoku jest ok, ale kolejne odświeżenie powoduje już wyżej wymieniony błąd.