Ver Mensaje Individual
  #6 (permalink)  
Antiguo 24/12/2012, 12:26
Avatar de ramiro_md
ramiro_md
 
Fecha de Ingreso: septiembre-2008
Mensajes: 274
Antigüedad: 15 años, 7 meses
Puntos: 26
Respuesta: Propel no inserta objeto como FK

Carlos, entiendo lo que indica el error. Incluso viendo la implementación del método parecería ilógico mandar el objeto como parámetro. Pero en los 2 casos anteriores y en los ejemplos de la documentación, así funciona.
Dejo el código del BaseUsuarios.php donde está definida la clase, en especial la parte de la institución:
Código PHP:
    /**
     * The value for the idinstituciondefault field.
     * Note: this column has a database default value of: 0
     * @var        int
     */
    
protected $idinstituciondefault;

/**
     * Set the value of [idinstituciondefault] column.
     *
     * @param int $v new value
     * @return Usuarios The current object (for fluent API support)
     */
    
public function setIdinstituciondefault($v)
    {
        if (
$v !== null) {
            
$v = (int) $v;
        }

        if (
$this->idinstituciondefault !== $v) {
            
$this->idinstituciondefault $v;
            
$this->modifiedColumns[] = UsuariosPeer::IDINSTITUCIONDEFAULT;
        }

        if (
$this->aInstituciones !== null && $this->aInstituciones->getIdinstitucion() !== $v) {
            
$this->aInstituciones null;
        }


        return 
$this;
    }