Search code examples
phpsymfonysonata

Sonata Admin: An error has occurred during the creation of item


I have actually a problem when i want to create something in my database with my admin panel which works with Sonata Admin. When i try, I have just this error: "An error has occurred during the creation of item" and when I use my Synfony2 logs, I have this error: enter image description here

I don't know how to correct this problem cause i dindn't found a topic which can help me :(

But I think that the problem is here:

    namespace Kayser\PlatformBundle\Entity\Repository;

use Doctrine\ORM\EntityRepository;

/**
 * AnnoncesRepository
 *
 * This class was generated by the Doctrine ORM. Add your own custom
 * repository methods below.
 */
class AnnoncesRepository extends EntityRepository
{
    public function findAll($order = array())
    {
        if (!sizeof($order)) {
            $order = array('order' => 'ASC');
        }
        return $this->findBy(array(), $order );
    }

}

If someone can help me :(


Solution

  • ORDER same as order is a reserved MySQL word, cannot be a column name.