Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9053749
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T13:30:19+00:00 2026-06-16T13:30:19+00:00

I’m trying to build the edit controller/view but i encounter this error. From i’ve

  • 0

I’m trying to build the “edit” controller/view but i encounter this error. From i’ve read it could be an asociation problem, and i’ve tried to fix it but i don’t know what it’s wrong with it. It supposed to return a collection but i don’t even know what “proxy” means and how it’s getting it.

The entity for which i’m building the edit view:

    <?php

namespace Monse\WebBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * Monse\WebBundle\Entity\BasedeDatos
 *
 * @ORM\Table()
 * @ORM\Entity
 */
class BasedeDatos
{
    /**
     * @var integer $id
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

   /**
* @ORM\ManyToOne(targetEntity="Monse\WebBundle\Entity\ServidoresBD")
* @ORM\JoinColumn(name="servidores_id", referencedColumnName="id",nullable=false)
*
*/
    private $servidorBD;

    /**
     * @var string $nombreBD
     *
     * @ORM\Column(name="nombreBD", type="string", length=255,unique=true)
     */
    private $nombreBD;


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

    /**
     * Set servidorBD
     *
     * @param integer $servidorBD
     */
    public function setServidorBD(\Monse\WebBundle\Entity\ServidoresBD $servidorBD)
    {
        $this->servidorBD = $servidorBD;
    }

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

    /**
     * Set nombreBD
     *
     * @param string $nombreBD
     */
    public function setNombreBD($nombreBD)
    {
        $this->nombreBD = $nombreBD;
    }

    /**
     * Get nombreBD
     *
     * @return string 
     */
    public function getNombreBD()
    {
        return $this->nombreBD;
    }
    public function __construct()
    {
        $this->servidorBD = new Doctrine\Common\Collections\ArrayCollection();
    }
}

FormType:

<?php

namespace Monse\WebBundle\Form;
use Doctrine\ORM\EntityRepository;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilder;

class BasedeDatosType extends AbstractType
{ 
    public function buildForm(FormBuilder $builder, array $options)
    {
        $builder
           ->add('ServidorBD','entity',
                  array ('class' => 'MonseWebBundle:ServidoresBD',
                        'multiple' => true, 
                        'required' => true, 
                        'label' => 'Servidor de Base de Datos: ',
                         'query_builder' => function(EntityRepository $er) {
                         return $er->createQueryBuilder('u')
                         ->orderBy('u.url', 'ASC');
                                                                           },
                         ))
            ->add('nombreBD','text', array( 'required' => true, 'label' => 'Nombre Base de Datos: '))
            ->add('UsuarioBD','entity',array('class' => 'MonseWebBundle:UsuariosBD','multiple' => true,
                                             'required' => true, 'label' => 'Usuario Asociado: ',
                                             'property_path' => false,
                                             'query_builder' => function (EntityRepository $er){
                                              return $er->createQueryBuilder('s')
                                              ->orderBy ('s.usuario','ASC'); },))
            ;

    }

    public function getName()
    {
        return 'basededatos';
    }
}

The entity responsible for the problem (i think):

<?php

namespace Monse\WebBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * Monse\WebBundle\Entity\ServidoresBD
 *
 * @ORM\Table()
 * @ORM\Entity
 */
class ServidoresBD
{
    /**
     * @var integer $id
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;
    /**
     * @var string $url
     *
     * @ORM\Column(name="url", type="string", length=255)
     */
    private $url;
  /**
   *
   * @ORM\OneToOne (targetEntity="Monse\WebBundle\Entity\Dominios")
   * @ORM\JoinColumn(name="dominio_id", referencedColumnName="id",nullable=false,unique=true)
   */
    private $dominio;


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

    /**
     * Set dominio
     *
     * @param integer $dominio
     */
    public function setDominio(\Monse\WebBundle\Entity\Dominios $dominio)
    {
        $this->dominio = $dominio;
    }

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

     /**
     * Set url
     *
     * @param string $url
     */
    public function setUrl($url)
    {
        $this->url = $url;
    }

    /**
     * Get url
     *
     * @return string 
     */
    public function getUrl()
    {
        return $this->url;
    }
    public function __toString()
{
    return $this->getUrl();
}

}

Form Type:

<?php

namespace Monse\WebBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilder;

class ServidoresBDType extends AbstractType
{
    public function buildForm(FormBuilder $builder, array $options)
    {
        $builder
            ->add('url')
            ->add('dominio', 'collection', array('type' => new DominiosType()));
        ;
    }
 public function getDefaultOptions(array $options)
    {   
        return array(
            'data_class' => 'Monse\WebBundle\Entity\ServidoresBD'
        );
    }
   public function getName()
{
    return 'issue_selector';
}
}

Where should i add the arraycollection to be returned? How do i prevent this from happening again? I’m sorry if this is an stupid question, i’m trying to learn.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T13:30:20+00:00Added an answer on June 16, 2026 at 1:30 pm

    I changed the two “multiple” attributes to false in the first form type.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This could be a duplicate question, but I have no idea what search terms
I am trying to find ID3V2 tags from MP3 file using jid3lib in Java.
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
Does anyone know how can I replace this 2 symbol below from the string
I have a view passing on information from a database: def serve_article(request, id): served_article
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am currently running into a problem where an element is coming back from
I am trying to understand how to use SyndicationItem to display feed which is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.