1

I'm having a similiar issue to Symfony2 Doctrine Unrecognized field: But mine doesn't have the same solution

I have an entity "category" I'm trying to find all the categories with the attribute "activo" set to true but it gives me the error in the title

I've done php app/console doctrine:generate:entities [path] --no-backup and php app/console doctrine:schema:update --force

My table in my database is updated just as my entity.

<?php

namespace ROSHKA\BBVA\SitioExperience\FrontendBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * Expcategorias
 */
class Expcategorias
{
    /**
     * @var integer
     */
    private $id;

    /**
     * @var string
     */
    private $nombre;

    /**
     * @var string
     */
    private $descripcion;

    /**
     * @var \ROSHKA\BBVA\SitioUniversos\ImagenesBundle\Entity\Imagenes
     */
    private $imagen;



/**
     * @var string
     */
    private $titulo;

/**
 * @var boolean
 */
private $activo;

/**
 * @var string
 */
private $colorfondo;

/**
 * @var \ROSHKA\BBVA\SitioUniversos\ImagenesBundle\Entity\Imagenes
 */
private $imagenfondo;    


/**
 * Get id
 *
 * @return integer 
 */
public function getId()
{
    return $this->id;
}

/**
 * Set nombre
 *
 * @param string $nombre
 * @return Expcategorias
 */
public function setNombre($nombre)
{
    $this->nombre = $nombre;

    return $this;
}

/**
 * Get nombre
 *
 * @return string 
 */
public function getNombre()
{
    return $this->nombre;
}

/**
 * Set descripcion
 *
 * @param string $descripcion
 * @return Expcategorias
 */
public function setDescripcion($descripcion)
{
    $this->descripcion = $descripcion;

    return $this;
}

/**
 * Get descripcion
 *
 * @return string 
 */
public function getDescripcion()
{
    return $this->descripcion;
}

/**
 * Set imagen
 *
 * @param \ROSHKA\BBVA\SitioUniversos\ImagenesBundle\Entity\Imagenes $imagen
 * @return Expcategorias
 */
public function setImagen(\ROSHKA\BBVA\SitioUniversos\ImagenesBundle\Entity\Imagenes $imagen = null)
{
    $this->imagen = $imagen;

    return $this;
}

/**
 * Get imagen
 *
 * @return \ROSHKA\BBVA\SitioUniversos\ImagenesBundle\Entity\Imagenes 
 */
public function getImagen()
{
    return $this->imagen;
}

public function __toString()
{
    return $this->getNombre();
}    

/**
 * Set titulo
 *
 * @param string $titulo
 * @return Expcategorias
 */
public function setTitulo($titulo)
{
    $this->titulo = $titulo;

    return $this;
}

/**
 * Get titulo
 *
 * @return string 
 */
public function getTitulo()
{
    return $this->titulo;
}

/**
 * Set activo
 *
 * @param boolean $activo
 * @return Expcategorias
 */
public function setActivo($activo)
{
    $this->activo = $activo;

    return $this;
}

/**
 * Get activo
 *
 * @return boolean 
 */
public function getActivo()
{
    return $this->activo;
}

/**
 * Set colorfondo
 *
 * @param string $colorfondo
 * @return Expcategorias
 */
public function setColorfondo($colorfondo)
{
    $this->colorfondo = $colorfondo;

    return $this;
}

/**
 * Get colorfondo
 *
 * @return string 
 */
public function getColorfondo()
{
    return $this->colorfondo;
}

/**
 * Set imagenfondo
 *
 * @param \ROSHKA\BBVA\SitioUniversos\ImagenesBundle\Entity\Imagenes $imagenfondo
 * @return Expcategorias
 */
public function setImagenfondo(\ROSHKA\BBVA\SitioUniversos\ImagenesBundle\Entity\Imagenes $imagenfondo = null)
{
    $this->imagenfondo = $imagenfondo;

    return $this;
}

/**
 * Get imagenfondo
 *
 * @return \ROSHKA\BBVA\SitioUniversos\ImagenesBundle\Entity\Imagenes 
 */
public function getImagenfondo()
{
    return $this->imagenfondo;
}

}

This is what I use to call it in my controller. When I debug and set a breakpoint here i can see in the expressions sections that my category only has three columns instead of the 9 columns that should have. I don't know what else to do.

$repo = $this->getDoctrine()->getRepository('ROSHKABBVASitioExperienceFrontendBundle:Expcategorias');
        $categorias = $repo->findBy(array('activo'=>true));  
2
  • A notion regarding the Symfony version: 2.3 is not anymore supported since May 2016! Ideally you should move to 3.4. Things have changed a lot in the new versions, and finding solutions that work for version 2.3 might be wasting of time, as you would have to make substantial changes to comply to the new versions. Migrate to a newer, stable version and then try solve the bugs. Commented Nov 2, 2018 at 9:43
  • I would love to move to the latest version, but that would take time and this project belongs to the company where I work, and moving to another version isn't in the plan. Commented Nov 2, 2018 at 11:46

1 Answer 1

1

After thinking for a while I remembered I've installed memcached, then all I did was restart memcached in the task manager, then my project took all the new values.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.