[Alba-desarrollo] SVN Alba r4593 - in prosistem/alba/trunk/alba/lib/model: map om

commits en pressenter.com.ar commits en pressenter.com.ar
Lun Abr 30 21:42:57 CEST 2007


Author: hsanchez
Date: 2007-04-30 16:42:54 -0300 (Mon, 30 Apr 2007)
New Revision: 4593

Modified:
   prosistem/alba/trunk/alba/lib/model/map/ResponsableMapBuilder.php
   prosistem/alba/trunk/alba/lib/model/om/BaseCuenta.php
   prosistem/alba/trunk/alba/lib/model/om/BaseProvincia.php
   prosistem/alba/trunk/alba/lib/model/om/BaseResponsable.php
   prosistem/alba/trunk/alba/lib/model/om/BaseResponsablePeer.php
   prosistem/alba/trunk/alba/lib/model/om/BaseRolResponsable.php
   prosistem/alba/trunk/alba/lib/model/om/BaseTipodocumento.php
Log:
Agregando el campo relacion al responsable, genere el nuevo modelo

Modified: prosistem/alba/trunk/alba/lib/model/map/ResponsableMapBuilder.php
===================================================================
--- prosistem/alba/trunk/alba/lib/model/map/ResponsableMapBuilder.php	2007-04-30 19:40:11 UTC (rev 4592)
+++ prosistem/alba/trunk/alba/lib/model/map/ResponsableMapBuilder.php	2007-04-30 19:42:54 UTC (rev 4593)
@@ -65,6 +65,8 @@
 		$tMap->addColumn('AUTORIZACION_RETIRO', 'AutorizacionRetiro', 'boolean', CreoleTypes::BOOLEAN, true);
 
 		$tMap->addForeignKey('FK_CUENTA_ID', 'FkCuentaId', 'int', CreoleTypes::INTEGER, 'cuenta', 'ID', true, null);
+
+		$tMap->addForeignKey('FK_ROLRESPONSABLE_ID', 'FkRolresponsableId', 'int', CreoleTypes::INTEGER, 'rol_responsable', 'ID', true, null);
 				
     } 
 } 
\ No newline at end of file

Modified: prosistem/alba/trunk/alba/lib/model/om/BaseCuenta.php
===================================================================
--- prosistem/alba/trunk/alba/lib/model/om/BaseCuenta.php	2007-04-30 19:40:11 UTC (rev 4592)
+++ prosistem/alba/trunk/alba/lib/model/om/BaseCuenta.php	2007-04-30 19:42:54 UTC (rev 4593)
@@ -1126,4 +1126,39 @@
 		return $this->collResponsables;
 	}
 
+
+	
+	public function getResponsablesJoinRolResponsable($criteria = null, $con = null)
+	{
+				include_once 'lib/model/om/BaseResponsablePeer.php';
+		if ($criteria === null) {
+			$criteria = new Criteria();
+		}
+		elseif ($criteria instanceof Criteria)
+		{
+			$criteria = clone $criteria;
+		}
+
+		if ($this->collResponsables === null) {
+			if ($this->isNew()) {
+				$this->collResponsables = array();
+			} else {
+
+				$criteria->add(ResponsablePeer::FK_CUENTA_ID, $this->getId());
+
+				$this->collResponsables = ResponsablePeer::doSelectJoinRolResponsable($criteria, $con);
+			}
+		} else {
+									
+			$criteria->add(ResponsablePeer::FK_CUENTA_ID, $this->getId());
+
+			if (!isset($this->lastResponsableCriteria) || !$this->lastResponsableCriteria->equals($criteria)) {
+				$this->collResponsables = ResponsablePeer::doSelectJoinRolResponsable($criteria, $con);
+			}
+		}
+		$this->lastResponsableCriteria = $criteria;
+
+		return $this->collResponsables;
+	}
+
 } 
\ No newline at end of file

Modified: prosistem/alba/trunk/alba/lib/model/om/BaseProvincia.php
===================================================================
--- prosistem/alba/trunk/alba/lib/model/om/BaseProvincia.php	2007-04-30 19:40:11 UTC (rev 4592)
+++ prosistem/alba/trunk/alba/lib/model/om/BaseProvincia.php	2007-04-30 19:42:54 UTC (rev 4593)
@@ -1325,7 +1325,42 @@
 		return $this->collResponsables;
 	}
 
+
 	
+	public function getResponsablesJoinRolResponsable($criteria = null, $con = null)
+	{
+				include_once 'lib/model/om/BaseResponsablePeer.php';
+		if ($criteria === null) {
+			$criteria = new Criteria();
+		}
+		elseif ($criteria instanceof Criteria)
+		{
+			$criteria = clone $criteria;
+		}
+
+		if ($this->collResponsables === null) {
+			if ($this->isNew()) {
+				$this->collResponsables = array();
+			} else {
+
+				$criteria->add(ResponsablePeer::FK_PROVINCIA_ID, $this->getId());
+
+				$this->collResponsables = ResponsablePeer::doSelectJoinRolResponsable($criteria, $con);
+			}
+		} else {
+									
+			$criteria->add(ResponsablePeer::FK_PROVINCIA_ID, $this->getId());
+
+			if (!isset($this->lastResponsableCriteria) || !$this->lastResponsableCriteria->equals($criteria)) {
+				$this->collResponsables = ResponsablePeer::doSelectJoinRolResponsable($criteria, $con);
+			}
+		}
+		$this->lastResponsableCriteria = $criteria;
+
+		return $this->collResponsables;
+	}
+
+	
 	public function initDocentes()
 	{
 		if ($this->collDocentes === null) {

Modified: prosistem/alba/trunk/alba/lib/model/om/BaseResponsable.php
===================================================================
--- prosistem/alba/trunk/alba/lib/model/om/BaseResponsable.php	2007-04-30 19:40:11 UTC (rev 4592)
+++ prosistem/alba/trunk/alba/lib/model/om/BaseResponsable.php	2007-04-30 19:42:54 UTC (rev 4593)
@@ -75,7 +75,11 @@
 	
 	protected $fk_cuenta_id = 0;
 
+
 	
+	protected $fk_rolresponsable_id = 1;
+
+	
 	protected $aCuenta;
 
 	
@@ -85,6 +89,9 @@
 	protected $aTipodocumento;
 
 	
+	protected $aRolResponsable;
+
+	
 	protected $collRelRolresponsableResponsables;
 
 	
@@ -216,6 +223,13 @@
 	}
 
 	
+	public function getFkRolresponsableId()
+	{
+
+		return $this->fk_rolresponsable_id;
+	}
+
+	
 	public function setId($v)
 	{
 
@@ -398,6 +412,20 @@
 
 	} 
 	
+	public function setFkRolresponsableId($v)
+	{
+
+		if ($this->fk_rolresponsable_id !== $v || $v === 1) {
+			$this->fk_rolresponsable_id = $v;
+			$this->modifiedColumns[] = ResponsablePeer::FK_ROLRESPONSABLE_ID;
+		}
+
+		if ($this->aRolResponsable !== null && $this->aRolResponsable->getId() !== $v) {
+			$this->aRolResponsable = null;
+		}
+
+	} 
+	
 	public function hydrate(ResultSet $rs, $startcol = 1)
 	{
 		try {
@@ -436,11 +464,13 @@
 
 			$this->fk_cuenta_id = $rs->getInt($startcol + 16);
 
+			$this->fk_rolresponsable_id = $rs->getInt($startcol + 17);
+
 			$this->resetModified();
 
 			$this->setNew(false);
 
-						return $startcol + 17; 
+						return $startcol + 18; 
 		} catch (Exception $e) {
 			throw new PropelException("Error populating Responsable object", $e);
 		}
@@ -519,7 +549,14 @@
 				$this->setTipodocumento($this->aTipodocumento);
 			}
 
+			if ($this->aRolResponsable !== null) {
+				if ($this->aRolResponsable->isModified()) {
+					$affectedRows += $this->aRolResponsable->save($con);
+				}
+				$this->setRolResponsable($this->aRolResponsable);
+			}
 
+
 						if ($this->isModified()) {
 				if ($this->isNew()) {
 					$pk = ResponsablePeer::doInsert($this, $con);
@@ -594,7 +631,13 @@
 				}
 			}
 
+			if ($this->aRolResponsable !== null) {
+				if (!$this->aRolResponsable->validate($columns)) {
+					$failureMap = array_merge($failureMap, $this->aRolResponsable->getValidationFailures());
+				}
+			}
 
+
 			if (($retval = ResponsablePeer::doValidate($this, $columns)) !== true) {
 				$failureMap = array_merge($failureMap, $retval);
 			}
@@ -677,6 +720,9 @@
 			case 16:
 				return $this->getFkCuentaId();
 				break;
+			case 17:
+				return $this->getFkRolresponsableId();
+				break;
 			default:
 				return null;
 				break;
@@ -704,6 +750,7 @@
 			$keys[14] => $this->getObservacion(),
 			$keys[15] => $this->getAutorizacionRetiro(),
 			$keys[16] => $this->getFkCuentaId(),
+			$keys[17] => $this->getFkRolresponsableId(),
 		);
 		return $result;
 	}
@@ -770,6 +817,9 @@
 			case 16:
 				$this->setFkCuentaId($value);
 				break;
+			case 17:
+				$this->setFkRolresponsableId($value);
+				break;
 		} 	}
 
 	
@@ -794,6 +844,7 @@
 		if (array_key_exists($keys[14], $arr)) $this->setObservacion($arr[$keys[14]]);
 		if (array_key_exists($keys[15], $arr)) $this->setAutorizacionRetiro($arr[$keys[15]]);
 		if (array_key_exists($keys[16], $arr)) $this->setFkCuentaId($arr[$keys[16]]);
+		if (array_key_exists($keys[17], $arr)) $this->setFkRolresponsableId($arr[$keys[17]]);
 	}
 
 	
@@ -818,6 +869,7 @@
 		if ($this->isColumnModified(ResponsablePeer::OBSERVACION)) $criteria->add(ResponsablePeer::OBSERVACION, $this->observacion);
 		if ($this->isColumnModified(ResponsablePeer::AUTORIZACION_RETIRO)) $criteria->add(ResponsablePeer::AUTORIZACION_RETIRO, $this->autorizacion_retiro);
 		if ($this->isColumnModified(ResponsablePeer::FK_CUENTA_ID)) $criteria->add(ResponsablePeer::FK_CUENTA_ID, $this->fk_cuenta_id);
+		if ($this->isColumnModified(ResponsablePeer::FK_ROLRESPONSABLE_ID)) $criteria->add(ResponsablePeer::FK_ROLRESPONSABLE_ID, $this->fk_rolresponsable_id);
 
 		return $criteria;
 	}
@@ -880,7 +932,9 @@
 
 		$copyObj->setFkCuentaId($this->fk_cuenta_id);
 
+		$copyObj->setFkRolresponsableId($this->fk_rolresponsable_id);
 
+
 		if ($deepCopy) {
 									$copyObj->setNew(false);
 
@@ -1004,6 +1058,36 @@
 	}
 
 	
+	public function setRolResponsable($v)
+	{
+
+
+		if ($v === null) {
+			$this->setFkRolresponsableId('1');
+		} else {
+			$this->setFkRolresponsableId($v->getId());
+		}
+
+
+		$this->aRolResponsable = $v;
+	}
+
+
+	
+	public function getRolResponsable($con = null)
+	{
+				include_once 'lib/model/om/BaseRolResponsablePeer.php';
+
+		if ($this->aRolResponsable === null && ($this->fk_rolresponsable_id !== null)) {
+
+			$this->aRolResponsable = RolResponsablePeer::retrieveByPK($this->fk_rolresponsable_id, $con);
+
+			
+		}
+		return $this->aRolResponsable;
+	}
+
+	
 	public function initRelRolresponsableResponsables()
 	{
 		if ($this->collRelRolresponsableResponsables === null) {

Modified: prosistem/alba/trunk/alba/lib/model/om/BaseResponsablePeer.php
===================================================================
--- prosistem/alba/trunk/alba/lib/model/om/BaseResponsablePeer.php	2007-04-30 19:40:11 UTC (rev 4592)
+++ prosistem/alba/trunk/alba/lib/model/om/BaseResponsablePeer.php	2007-04-30 19:42:54 UTC (rev 4593)
@@ -13,7 +13,7 @@
 	const CLASS_DEFAULT = 'lib.model.Responsable';
 
 	
-	const NUM_COLUMNS = 17;
+	const NUM_COLUMNS = 18;
 
 	
 	const NUM_LAZY_LOAD_COLUMNS = 0;
@@ -71,23 +71,26 @@
 	const FK_CUENTA_ID = 'responsable.FK_CUENTA_ID';
 
 	
+	const FK_ROLRESPONSABLE_ID = 'responsable.FK_ROLRESPONSABLE_ID';
+
+	
 	private static $phpNameMap = null;
 
 
 	
 	private static $fieldNames = array (
-		BasePeer::TYPE_PHPNAME => array ('Id', 'Nombre', 'Apellido', 'Direccion', 'Ciudad', 'CodigoPostal', 'FkProvinciaId', 'Telefono', 'TelefonoMovil', 'NroDocumento', 'FkTipodocumentoId', 'Sexo', 'Email', 'Relacion', 'Observacion', 'AutorizacionRetiro', 'FkCuentaId', ),
-		BasePeer::TYPE_COLNAME => array (ResponsablePeer::ID, ResponsablePeer::NOMBRE, ResponsablePeer::APELLIDO, ResponsablePeer::DIRECCION, ResponsablePeer::CIUDAD, ResponsablePeer::CODIGO_POSTAL, ResponsablePeer::FK_PROVINCIA_ID, ResponsablePeer::TELEFONO, ResponsablePeer::TELEFONO_MOVIL, ResponsablePeer::NRO_DOCUMENTO, ResponsablePeer::FK_TIPODOCUMENTO_ID, ResponsablePeer::SEXO, ResponsablePeer::EMAIL, ResponsablePeer::RELACION, ResponsablePeer::OBSERVACION, ResponsablePeer::AUTORIZACION_RETIRO, ResponsablePeer::FK_CUENTA_ID, ),
-		BasePeer::TYPE_FIELDNAME => array ('id', 'nombre', 'apellido', 'direccion', 'ciudad', 'codigo_postal', 'fk_provincia_id', 'telefono', 'telefono_movil', 'nro_documento', 'fk_tipodocumento_id', 'sexo', 'email', 'relacion', 'observacion', 'autorizacion_retiro', 'fk_cuenta_id', ),
-		BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, )
+		BasePeer::TYPE_PHPNAME => array ('Id', 'Nombre', 'Apellido', 'Direccion', 'Ciudad', 'CodigoPostal', 'FkProvinciaId', 'Telefono', 'TelefonoMovil', 'NroDocumento', 'FkTipodocumentoId', 'Sexo', 'Email', 'Relacion', 'Observacion', 'AutorizacionRetiro', 'FkCuentaId', 'FkRolresponsableId', ),
+		BasePeer::TYPE_COLNAME => array (ResponsablePeer::ID, ResponsablePeer::NOMBRE, ResponsablePeer::APELLIDO, ResponsablePeer::DIRECCION, ResponsablePeer::CIUDAD, ResponsablePeer::CODIGO_POSTAL, ResponsablePeer::FK_PROVINCIA_ID, ResponsablePeer::TELEFONO, ResponsablePeer::TELEFONO_MOVIL, ResponsablePeer::NRO_DOCUMENTO, ResponsablePeer::FK_TIPODOCUMENTO_ID, ResponsablePeer::SEXO, ResponsablePeer::EMAIL, ResponsablePeer::RELACION, ResponsablePeer::OBSERVACION, ResponsablePeer::AUTORIZACION_RETIRO, ResponsablePeer::FK_CUENTA_ID, ResponsablePeer::FK_ROLRESPONSABLE_ID, ),
+		BasePeer::TYPE_FIELDNAME => array ('id', 'nombre', 'apellido', 'direccion', 'ciudad', 'codigo_postal', 'fk_provincia_id', 'telefono', 'telefono_movil', 'nro_documento', 'fk_tipodocumento_id', 'sexo', 'email', 'relacion', 'observacion', 'autorizacion_retiro', 'fk_cuenta_id', 'fk_rolresponsable_id', ),
+		BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, )
 	);
 
 	
 	private static $fieldKeys = array (
-		BasePeer::TYPE_PHPNAME => array ('Id' => 0, 'Nombre' => 1, 'Apellido' => 2, 'Direccion' => 3, 'Ciudad' => 4, 'CodigoPostal' => 5, 'FkProvinciaId' => 6, 'Telefono' => 7, 'TelefonoMovil' => 8, 'NroDocumento' => 9, 'FkTipodocumentoId' => 10, 'Sexo' => 11, 'Email' => 12, 'Relacion' => 13, 'Observacion' => 14, 'AutorizacionRetiro' => 15, 'FkCuentaId' => 16, ),
-		BasePeer::TYPE_COLNAME => array (ResponsablePeer::ID => 0, ResponsablePeer::NOMBRE => 1, ResponsablePeer::APELLIDO => 2, ResponsablePeer::DIRECCION => 3, ResponsablePeer::CIUDAD => 4, ResponsablePeer::CODIGO_POSTAL => 5, ResponsablePeer::FK_PROVINCIA_ID => 6, ResponsablePeer::TELEFONO => 7, ResponsablePeer::TELEFONO_MOVIL => 8, ResponsablePeer::NRO_DOCUMENTO => 9, ResponsablePeer::FK_TIPODOCUMENTO_ID => 10, ResponsablePeer::SEXO => 11, ResponsablePeer::EMAIL => 12, ResponsablePeer::RELACION => 13, ResponsablePeer::OBSERVACION => 14, ResponsablePeer::AUTORIZACION_RETIRO => 15, ResponsablePeer::FK_CUENTA_ID => 16, ),
-		BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'nombre' => 1, 'apellido' => 2, 'direccion' => 3, 'ciudad' => 4, 'codigo_postal' => 5, 'fk_provincia_id' => 6, 'telefono' => 7, 'telefono_movil' => 8, 'nro_documento' => 9, 'fk_tipodocumento_id' => 10, 'sexo' => 11, 'email' => 12, 'relacion' => 13, 'observacion' => 14, 'autorizacion_retiro' => 15, 'fk_cuenta_id' => 16, ),
-		BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, )
+		BasePeer::TYPE_PHPNAME => array ('Id' => 0, 'Nombre' => 1, 'Apellido' => 2, 'Direccion' => 3, 'Ciudad' => 4, 'CodigoPostal' => 5, 'FkProvinciaId' => 6, 'Telefono' => 7, 'TelefonoMovil' => 8, 'NroDocumento' => 9, 'FkTipodocumentoId' => 10, 'Sexo' => 11, 'Email' => 12, 'Relacion' => 13, 'Observacion' => 14, 'AutorizacionRetiro' => 15, 'FkCuentaId' => 16, 'FkRolresponsableId' => 17, ),
+		BasePeer::TYPE_COLNAME => array (ResponsablePeer::ID => 0, ResponsablePeer::NOMBRE => 1, ResponsablePeer::APELLIDO => 2, ResponsablePeer::DIRECCION => 3, ResponsablePeer::CIUDAD => 4, ResponsablePeer::CODIGO_POSTAL => 5, ResponsablePeer::FK_PROVINCIA_ID => 6, ResponsablePeer::TELEFONO => 7, ResponsablePeer::TELEFONO_MOVIL => 8, ResponsablePeer::NRO_DOCUMENTO => 9, ResponsablePeer::FK_TIPODOCUMENTO_ID => 10, ResponsablePeer::SEXO => 11, ResponsablePeer::EMAIL => 12, ResponsablePeer::RELACION => 13, ResponsablePeer::OBSERVACION => 14, ResponsablePeer::AUTORIZACION_RETIRO => 15, ResponsablePeer::FK_CUENTA_ID => 16, ResponsablePeer::FK_ROLRESPONSABLE_ID => 17, ),
+		BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'nombre' => 1, 'apellido' => 2, 'direccion' => 3, 'ciudad' => 4, 'codigo_postal' => 5, 'fk_provincia_id' => 6, 'telefono' => 7, 'telefono_movil' => 8, 'nro_documento' => 9, 'fk_tipodocumento_id' => 10, 'sexo' => 11, 'email' => 12, 'relacion' => 13, 'observacion' => 14, 'autorizacion_retiro' => 15, 'fk_cuenta_id' => 16, 'fk_rolresponsable_id' => 17, ),
+		BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, )
 	);
 
 	
@@ -175,6 +178,8 @@
 
 		$criteria->addSelectColumn(ResponsablePeer::FK_CUENTA_ID);
 
+		$criteria->addSelectColumn(ResponsablePeer::FK_ROLRESPONSABLE_ID);
+
 	}
 
 	const COUNT = 'COUNT(responsable.ID)';
@@ -338,6 +343,34 @@
 
 
 	
+	public static function doCountJoinRolResponsable(Criteria $criteria, $distinct = false, $con = null)
+	{
+				$criteria = clone $criteria;
+		
+				$criteria->clearSelectColumns()->clearOrderByColumns();
+		if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
+			$criteria->addSelectColumn(ResponsablePeer::COUNT_DISTINCT);
+		} else {
+			$criteria->addSelectColumn(ResponsablePeer::COUNT);
+		}
+		
+				foreach($criteria->getGroupByColumns() as $column)
+		{
+			$criteria->addSelectColumn($column);
+		}
+
+		$criteria->addJoin(ResponsablePeer::FK_ROLRESPONSABLE_ID, RolResponsablePeer::ID);
+
+		$rs = ResponsablePeer::doSelectRS($criteria, $con);
+		if ($rs->next()) {
+			return $rs->getInt(1);
+		} else {
+						return 0;
+		}
+	}
+
+
+	
 	public static function doSelectJoinCuenta(Criteria $c, $con = null)
 	{
 		$c = clone $c;
@@ -479,6 +512,53 @@
 
 
 	
+	public static function doSelectJoinRolResponsable(Criteria $c, $con = null)
+	{
+		$c = clone $c;
+
+				if ($c->getDbName() == Propel::getDefaultDB()) {
+			$c->setDbName(self::DATABASE_NAME);
+		}
+
+		ResponsablePeer::addSelectColumns($c);
+		$startcol = (ResponsablePeer::NUM_COLUMNS - ResponsablePeer::NUM_LAZY_LOAD_COLUMNS) + 1;
+		RolResponsablePeer::addSelectColumns($c);
+
+		$c->addJoin(ResponsablePeer::FK_ROLRESPONSABLE_ID, RolResponsablePeer::ID);
+		$rs = BasePeer::doSelect($c, $con);
+		$results = array();
+
+		while($rs->next()) {
+
+			$omClass = ResponsablePeer::getOMClass();
+
+			$cls = Propel::import($omClass);
+			$obj1 = new $cls();
+			$obj1->hydrate($rs);
+
+			$omClass = RolResponsablePeer::getOMClass();
+
+			$cls = Propel::import($omClass);
+			$obj2 = new $cls();
+			$obj2->hydrate($rs, $startcol);
+
+			$newObject = true;
+			foreach($results as $temp_obj1) {
+				$temp_obj2 = $temp_obj1->getRolResponsable(); 				if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
+					$newObject = false;
+										$temp_obj2->addResponsable($obj1); 					break;
+				}
+			}
+			if ($newObject) {
+				$obj2->initResponsables();
+				$obj2->addResponsable($obj1); 			}
+			$results[] = $obj1;
+		}
+		return $results;
+	}
+
+
+	
 	public static function doCountJoinAll(Criteria $criteria, $distinct = false, $con = null)
 	{
 		$criteria = clone $criteria;
@@ -501,6 +581,8 @@
 
 		$criteria->addJoin(ResponsablePeer::FK_TIPODOCUMENTO_ID, TipodocumentoPeer::ID);
 
+		$criteria->addJoin(ResponsablePeer::FK_ROLRESPONSABLE_ID, RolResponsablePeer::ID);
+
 		$rs = ResponsablePeer::doSelectRS($criteria, $con);
 		if ($rs->next()) {
 			return $rs->getInt(1);
@@ -531,12 +613,17 @@
 		TipodocumentoPeer::addSelectColumns($c);
 		$startcol5 = $startcol4 + TipodocumentoPeer::NUM_COLUMNS;
 
+		RolResponsablePeer::addSelectColumns($c);
+		$startcol6 = $startcol5 + RolResponsablePeer::NUM_COLUMNS;
+
 		$c->addJoin(ResponsablePeer::FK_CUENTA_ID, CuentaPeer::ID);
 
 		$c->addJoin(ResponsablePeer::FK_PROVINCIA_ID, ProvinciaPeer::ID);
 
 		$c->addJoin(ResponsablePeer::FK_TIPODOCUMENTO_ID, TipodocumentoPeer::ID);
 
+		$c->addJoin(ResponsablePeer::FK_ROLRESPONSABLE_ID, RolResponsablePeer::ID);
+
 		$rs = BasePeer::doSelect($c, $con);
 		$results = array();
 		
@@ -618,6 +705,29 @@
 				$obj4->addResponsable($obj1);
 			}
 
+				
+					
+			$omClass = RolResponsablePeer::getOMClass();
+
+	
+			$cls = Propel::import($omClass);
+			$obj5 = new $cls();
+			$obj5->hydrate($rs, $startcol5);
+			
+			$newObject = true;
+			for ($j=0, $resCount=count($results); $j < $resCount; $j++) {
+				$temp_obj1 = $results[$j];
+				$temp_obj5 = $temp_obj1->getRolResponsable(); 				if ($temp_obj5->getPrimaryKey() === $obj5->getPrimaryKey()) {
+					$newObject = false;
+					$temp_obj5->addResponsable($obj1); 					break;
+				}
+			}
+			
+			if ($newObject) {
+				$obj5->initResponsables();
+				$obj5->addResponsable($obj1);
+			}
+
 			$results[] = $obj1;
 		}
 		return $results;
@@ -645,6 +755,8 @@
 
 		$criteria->addJoin(ResponsablePeer::FK_TIPODOCUMENTO_ID, TipodocumentoPeer::ID);
 
+		$criteria->addJoin(ResponsablePeer::FK_ROLRESPONSABLE_ID, RolResponsablePeer::ID);
+
 		$rs = ResponsablePeer::doSelectRS($criteria, $con);
 		if ($rs->next()) {
 			return $rs->getInt(1);
@@ -675,6 +787,8 @@
 
 		$criteria->addJoin(ResponsablePeer::FK_TIPODOCUMENTO_ID, TipodocumentoPeer::ID);
 
+		$criteria->addJoin(ResponsablePeer::FK_ROLRESPONSABLE_ID, RolResponsablePeer::ID);
+
 		$rs = ResponsablePeer::doSelectRS($criteria, $con);
 		if ($rs->next()) {
 			return $rs->getInt(1);
@@ -705,6 +819,8 @@
 
 		$criteria->addJoin(ResponsablePeer::FK_PROVINCIA_ID, ProvinciaPeer::ID);
 
+		$criteria->addJoin(ResponsablePeer::FK_ROLRESPONSABLE_ID, RolResponsablePeer::ID);
+
 		$rs = ResponsablePeer::doSelectRS($criteria, $con);
 		if ($rs->next()) {
 			return $rs->getInt(1);
@@ -715,6 +831,38 @@
 
 
 	
+	public static function doCountJoinAllExceptRolResponsable(Criteria $criteria, $distinct = false, $con = null)
+	{
+				$criteria = clone $criteria;
+		
+				$criteria->clearSelectColumns()->clearOrderByColumns();
+		if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
+			$criteria->addSelectColumn(ResponsablePeer::COUNT_DISTINCT);
+		} else {
+			$criteria->addSelectColumn(ResponsablePeer::COUNT);
+		}
+		
+				foreach($criteria->getGroupByColumns() as $column)
+		{
+			$criteria->addSelectColumn($column);
+		}
+
+		$criteria->addJoin(ResponsablePeer::FK_CUENTA_ID, CuentaPeer::ID);
+
+		$criteria->addJoin(ResponsablePeer::FK_PROVINCIA_ID, ProvinciaPeer::ID);
+
+		$criteria->addJoin(ResponsablePeer::FK_TIPODOCUMENTO_ID, TipodocumentoPeer::ID);
+
+		$rs = ResponsablePeer::doSelectRS($criteria, $con);
+		if ($rs->next()) {
+			return $rs->getInt(1);
+		} else {
+						return 0;
+		}
+	}
+
+
+	
 	public static function doSelectJoinAllExceptCuenta(Criteria $c, $con = null)
 	{
 		$c = clone $c;
@@ -732,11 +880,16 @@
 		TipodocumentoPeer::addSelectColumns($c);
 		$startcol4 = $startcol3 + TipodocumentoPeer::NUM_COLUMNS;
 
+		RolResponsablePeer::addSelectColumns($c);
+		$startcol5 = $startcol4 + RolResponsablePeer::NUM_COLUMNS;
+
 		$c->addJoin(ResponsablePeer::FK_PROVINCIA_ID, ProvinciaPeer::ID);
 
 		$c->addJoin(ResponsablePeer::FK_TIPODOCUMENTO_ID, TipodocumentoPeer::ID);
 
+		$c->addJoin(ResponsablePeer::FK_ROLRESPONSABLE_ID, RolResponsablePeer::ID);
 
+
 		$rs = BasePeer::doSelect($c, $con);
 		$results = array();
 		
@@ -792,6 +945,28 @@
 				$obj3->addResponsable($obj1);
 			}
 
+			$omClass = RolResponsablePeer::getOMClass();
+
+	
+			$cls = Propel::import($omClass);
+			$obj4  = new $cls();
+			$obj4->hydrate($rs, $startcol4);
+			
+			$newObject = true;
+			for ($j=0, $resCount=count($results); $j < $resCount; $j++) {
+				$temp_obj1 = $results[$j];
+				$temp_obj4 = $temp_obj1->getRolResponsable(); 				if ($temp_obj4->getPrimaryKey() === $obj4->getPrimaryKey()) {
+					$newObject = false;
+					$temp_obj4->addResponsable($obj1);
+					break;
+				}
+			}
+			
+			if ($newObject) {
+				$obj4->initResponsables();
+				$obj4->addResponsable($obj1);
+			}
+
 			$results[] = $obj1;
 		}
 		return $results;
@@ -816,11 +991,16 @@
 		TipodocumentoPeer::addSelectColumns($c);
 		$startcol4 = $startcol3 + TipodocumentoPeer::NUM_COLUMNS;
 
+		RolResponsablePeer::addSelectColumns($c);
+		$startcol5 = $startcol4 + RolResponsablePeer::NUM_COLUMNS;
+
 		$c->addJoin(ResponsablePeer::FK_CUENTA_ID, CuentaPeer::ID);
 
 		$c->addJoin(ResponsablePeer::FK_TIPODOCUMENTO_ID, TipodocumentoPeer::ID);
 
+		$c->addJoin(ResponsablePeer::FK_ROLRESPONSABLE_ID, RolResponsablePeer::ID);
 
+
 		$rs = BasePeer::doSelect($c, $con);
 		$results = array();
 		
@@ -876,6 +1056,28 @@
 				$obj3->addResponsable($obj1);
 			}
 
+			$omClass = RolResponsablePeer::getOMClass();
+
+	
+			$cls = Propel::import($omClass);
+			$obj4  = new $cls();
+			$obj4->hydrate($rs, $startcol4);
+			
+			$newObject = true;
+			for ($j=0, $resCount=count($results); $j < $resCount; $j++) {
+				$temp_obj1 = $results[$j];
+				$temp_obj4 = $temp_obj1->getRolResponsable(); 				if ($temp_obj4->getPrimaryKey() === $obj4->getPrimaryKey()) {
+					$newObject = false;
+					$temp_obj4->addResponsable($obj1);
+					break;
+				}
+			}
+			
+			if ($newObject) {
+				$obj4->initResponsables();
+				$obj4->addResponsable($obj1);
+			}
+
 			$results[] = $obj1;
 		}
 		return $results;
@@ -900,11 +1102,16 @@
 		ProvinciaPeer::addSelectColumns($c);
 		$startcol4 = $startcol3 + ProvinciaPeer::NUM_COLUMNS;
 
+		RolResponsablePeer::addSelectColumns($c);
+		$startcol5 = $startcol4 + RolResponsablePeer::NUM_COLUMNS;
+
 		$c->addJoin(ResponsablePeer::FK_CUENTA_ID, CuentaPeer::ID);
 
 		$c->addJoin(ResponsablePeer::FK_PROVINCIA_ID, ProvinciaPeer::ID);
 
+		$c->addJoin(ResponsablePeer::FK_ROLRESPONSABLE_ID, RolResponsablePeer::ID);
 
+
 		$rs = BasePeer::doSelect($c, $con);
 		$results = array();
 		
@@ -960,12 +1167,145 @@
 				$obj3->addResponsable($obj1);
 			}
 
+			$omClass = RolResponsablePeer::getOMClass();
+
+	
+			$cls = Propel::import($omClass);
+			$obj4  = new $cls();
+			$obj4->hydrate($rs, $startcol4);
+			
+			$newObject = true;
+			for ($j=0, $resCount=count($results); $j < $resCount; $j++) {
+				$temp_obj1 = $results[$j];
+				$temp_obj4 = $temp_obj1->getRolResponsable(); 				if ($temp_obj4->getPrimaryKey() === $obj4->getPrimaryKey()) {
+					$newObject = false;
+					$temp_obj4->addResponsable($obj1);
+					break;
+				}
+			}
+			
+			if ($newObject) {
+				$obj4->initResponsables();
+				$obj4->addResponsable($obj1);
+			}
+
 			$results[] = $obj1;
 		}
 		return $results;
 	}
 
+
 	
+	public static function doSelectJoinAllExceptRolResponsable(Criteria $c, $con = null)
+	{
+		$c = clone $c;
+
+								if ($c->getDbName() == Propel::getDefaultDB()) {
+			$c->setDbName(self::DATABASE_NAME);
+		}
+
+		ResponsablePeer::addSelectColumns($c);
+		$startcol2 = (ResponsablePeer::NUM_COLUMNS - ResponsablePeer::NUM_LAZY_LOAD_COLUMNS) + 1;
+
+		CuentaPeer::addSelectColumns($c);
+		$startcol3 = $startcol2 + CuentaPeer::NUM_COLUMNS;
+
+		ProvinciaPeer::addSelectColumns($c);
+		$startcol4 = $startcol3 + ProvinciaPeer::NUM_COLUMNS;
+
+		TipodocumentoPeer::addSelectColumns($c);
+		$startcol5 = $startcol4 + TipodocumentoPeer::NUM_COLUMNS;
+
+		$c->addJoin(ResponsablePeer::FK_CUENTA_ID, CuentaPeer::ID);
+
+		$c->addJoin(ResponsablePeer::FK_PROVINCIA_ID, ProvinciaPeer::ID);
+
+		$c->addJoin(ResponsablePeer::FK_TIPODOCUMENTO_ID, TipodocumentoPeer::ID);
+
+
+		$rs = BasePeer::doSelect($c, $con);
+		$results = array();
+		
+		while($rs->next()) {
+
+			$omClass = ResponsablePeer::getOMClass();
+
+			$cls = Propel::import($omClass);
+			$obj1 = new $cls();
+			$obj1->hydrate($rs);		
+
+			$omClass = CuentaPeer::getOMClass();
+
+	
+			$cls = Propel::import($omClass);
+			$obj2  = new $cls();
+			$obj2->hydrate($rs, $startcol2);
+			
+			$newObject = true;
+			for ($j=0, $resCount=count($results); $j < $resCount; $j++) {
+				$temp_obj1 = $results[$j];
+				$temp_obj2 = $temp_obj1->getCuenta(); 				if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
+					$newObject = false;
+					$temp_obj2->addResponsable($obj1);
+					break;
+				}
+			}
+			
+			if ($newObject) {
+				$obj2->initResponsables();
+				$obj2->addResponsable($obj1);
+			}
+
+			$omClass = ProvinciaPeer::getOMClass();
+
+	
+			$cls = Propel::import($omClass);
+			$obj3  = new $cls();
+			$obj3->hydrate($rs, $startcol3);
+			
+			$newObject = true;
+			for ($j=0, $resCount=count($results); $j < $resCount; $j++) {
+				$temp_obj1 = $results[$j];
+				$temp_obj3 = $temp_obj1->getProvincia(); 				if ($temp_obj3->getPrimaryKey() === $obj3->getPrimaryKey()) {
+					$newObject = false;
+					$temp_obj3->addResponsable($obj1);
+					break;
+				}
+			}
+			
+			if ($newObject) {
+				$obj3->initResponsables();
+				$obj3->addResponsable($obj1);
+			}
+
+			$omClass = TipodocumentoPeer::getOMClass();
+
+	
+			$cls = Propel::import($omClass);
+			$obj4  = new $cls();
+			$obj4->hydrate($rs, $startcol4);
+			
+			$newObject = true;
+			for ($j=0, $resCount=count($results); $j < $resCount; $j++) {
+				$temp_obj1 = $results[$j];
+				$temp_obj4 = $temp_obj1->getTipodocumento(); 				if ($temp_obj4->getPrimaryKey() === $obj4->getPrimaryKey()) {
+					$newObject = false;
+					$temp_obj4->addResponsable($obj1);
+					break;
+				}
+			}
+			
+			if ($newObject) {
+				$obj4->initResponsables();
+				$obj4->addResponsable($obj1);
+			}
+
+			$results[] = $obj1;
+		}
+		return $results;
+	}
+
+	
 	public static function getTableMap()
 	{
 		return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);

Modified: prosistem/alba/trunk/alba/lib/model/om/BaseRolResponsable.php
===================================================================
--- prosistem/alba/trunk/alba/lib/model/om/BaseRolResponsable.php	2007-04-30 19:40:11 UTC (rev 4592)
+++ prosistem/alba/trunk/alba/lib/model/om/BaseRolResponsable.php	2007-04-30 19:42:54 UTC (rev 4593)
@@ -24,6 +24,12 @@
 	protected $activo = true;
 
 	
+	protected $collResponsables;
+
+	
+	protected $lastResponsableCriteria = null;
+
+	
 	protected $collRelRolresponsableResponsables;
 
 	
@@ -188,6 +194,14 @@
 				}
 				$this->resetModified(); 			}
 
+			if ($this->collResponsables !== null) {
+				foreach($this->collResponsables as $referrerFK) {
+					if (!$referrerFK->isDeleted()) {
+						$affectedRows += $referrerFK->save($con);
+					}
+				}
+			}
+
 			if ($this->collRelRolresponsableResponsables !== null) {
 				foreach($this->collRelRolresponsableResponsables as $referrerFK) {
 					if (!$referrerFK->isDeleted()) {
@@ -237,6 +251,14 @@
 			}
 
 
+				if ($this->collResponsables !== null) {
+					foreach($this->collResponsables as $referrerFK) {
+						if (!$referrerFK->validate($columns)) {
+							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
+						}
+					}
+				}
+
 				if ($this->collRelRolresponsableResponsables !== null) {
 					foreach($this->collRelRolresponsableResponsables as $referrerFK) {
 						if (!$referrerFK->validate($columns)) {
@@ -378,6 +400,10 @@
 		if ($deepCopy) {
 									$copyObj->setNew(false);
 
+			foreach($this->getResponsables() as $relObj) {
+				$copyObj->addResponsable($relObj->copy($deepCopy));
+			}
+
 			foreach($this->getRelRolresponsableResponsables() as $relObj) {
 				$copyObj->addRelRolresponsableResponsable($relObj->copy($deepCopy));
 			}
@@ -408,6 +434,181 @@
 	}
 
 	
+	public function initResponsables()
+	{
+		if ($this->collResponsables === null) {
+			$this->collResponsables = array();
+		}
+	}
+
+	
+	public function getResponsables($criteria = null, $con = null)
+	{
+				include_once 'lib/model/om/BaseResponsablePeer.php';
+		if ($criteria === null) {
+			$criteria = new Criteria();
+		}
+		elseif ($criteria instanceof Criteria)
+		{
+			$criteria = clone $criteria;
+		}
+
+		if ($this->collResponsables === null) {
+			if ($this->isNew()) {
+			   $this->collResponsables = array();
+			} else {
+
+				$criteria->add(ResponsablePeer::FK_ROLRESPONSABLE_ID, $this->getId());
+
+				ResponsablePeer::addSelectColumns($criteria);
+				$this->collResponsables = ResponsablePeer::doSelect($criteria, $con);
+			}
+		} else {
+						if (!$this->isNew()) {
+												
+
+				$criteria->add(ResponsablePeer::FK_ROLRESPONSABLE_ID, $this->getId());
+
+				ResponsablePeer::addSelectColumns($criteria);
+				if (!isset($this->lastResponsableCriteria) || !$this->lastResponsableCriteria->equals($criteria)) {
+					$this->collResponsables = ResponsablePeer::doSelect($criteria, $con);
+				}
+			}
+		}
+		$this->lastResponsableCriteria = $criteria;
+		return $this->collResponsables;
+	}
+
+	
+	public function countResponsables($criteria = null, $distinct = false, $con = null)
+	{
+				include_once 'lib/model/om/BaseResponsablePeer.php';
+		if ($criteria === null) {
+			$criteria = new Criteria();
+		}
+		elseif ($criteria instanceof Criteria)
+		{
+			$criteria = clone $criteria;
+		}
+
+		$criteria->add(ResponsablePeer::FK_ROLRESPONSABLE_ID, $this->getId());
+
+		return ResponsablePeer::doCount($criteria, $distinct, $con);
+	}
+
+	
+	public function addResponsable(Responsable $l)
+	{
+		$this->collResponsables[] = $l;
+		$l->setRolResponsable($this);
+	}
+
+
+	
+	public function getResponsablesJoinCuenta($criteria = null, $con = null)
+	{
+				include_once 'lib/model/om/BaseResponsablePeer.php';
+		if ($criteria === null) {
+			$criteria = new Criteria();
+		}
+		elseif ($criteria instanceof Criteria)
+		{
+			$criteria = clone $criteria;
+		}
+
+		if ($this->collResponsables === null) {
+			if ($this->isNew()) {
+				$this->collResponsables = array();
+			} else {
+
+				$criteria->add(ResponsablePeer::FK_ROLRESPONSABLE_ID, $this->getId());
+
+				$this->collResponsables = ResponsablePeer::doSelectJoinCuenta($criteria, $con);
+			}
+		} else {
+									
+			$criteria->add(ResponsablePeer::FK_ROLRESPONSABLE_ID, $this->getId());
+
+			if (!isset($this->lastResponsableCriteria) || !$this->lastResponsableCriteria->equals($criteria)) {
+				$this->collResponsables = ResponsablePeer::doSelectJoinCuenta($criteria, $con);
+			}
+		}
+		$this->lastResponsableCriteria = $criteria;
+
+		return $this->collResponsables;
+	}
+
+
+	
+	public function getResponsablesJoinProvincia($criteria = null, $con = null)
+	{
+				include_once 'lib/model/om/BaseResponsablePeer.php';
+		if ($criteria === null) {
+			$criteria = new Criteria();
+		}
+		elseif ($criteria instanceof Criteria)
+		{
+			$criteria = clone $criteria;
+		}
+
+		if ($this->collResponsables === null) {
+			if ($this->isNew()) {
+				$this->collResponsables = array();
+			} else {
+
+				$criteria->add(ResponsablePeer::FK_ROLRESPONSABLE_ID, $this->getId());
+
+				$this->collResponsables = ResponsablePeer::doSelectJoinProvincia($criteria, $con);
+			}
+		} else {
+									
+			$criteria->add(ResponsablePeer::FK_ROLRESPONSABLE_ID, $this->getId());
+
+			if (!isset($this->lastResponsableCriteria) || !$this->lastResponsableCriteria->equals($criteria)) {
+				$this->collResponsables = ResponsablePeer::doSelectJoinProvincia($criteria, $con);
+			}
+		}
+		$this->lastResponsableCriteria = $criteria;
+
+		return $this->collResponsables;
+	}
+
+
+	
+	public function getResponsablesJoinTipodocumento($criteria = null, $con = null)
+	{
+				include_once 'lib/model/om/BaseResponsablePeer.php';
+		if ($criteria === null) {
+			$criteria = new Criteria();
+		}
+		elseif ($criteria instanceof Criteria)
+		{
+			$criteria = clone $criteria;
+		}
+
+		if ($this->collResponsables === null) {
+			if ($this->isNew()) {
+				$this->collResponsables = array();
+			} else {
+
+				$criteria->add(ResponsablePeer::FK_ROLRESPONSABLE_ID, $this->getId());
+
+				$this->collResponsables = ResponsablePeer::doSelectJoinTipodocumento($criteria, $con);
+			}
+		} else {
+									
+			$criteria->add(ResponsablePeer::FK_ROLRESPONSABLE_ID, $this->getId());
+
+			if (!isset($this->lastResponsableCriteria) || !$this->lastResponsableCriteria->equals($criteria)) {
+				$this->collResponsables = ResponsablePeer::doSelectJoinTipodocumento($criteria, $con);
+			}
+		}
+		$this->lastResponsableCriteria = $criteria;
+
+		return $this->collResponsables;
+	}
+
+	
 	public function initRelRolresponsableResponsables()
 	{
 		if ($this->collRelRolresponsableResponsables === null) {

Modified: prosistem/alba/trunk/alba/lib/model/om/BaseTipodocumento.php
===================================================================
--- prosistem/alba/trunk/alba/lib/model/om/BaseTipodocumento.php	2007-04-30 19:40:11 UTC (rev 4592)
+++ prosistem/alba/trunk/alba/lib/model/om/BaseTipodocumento.php	2007-04-30 19:42:54 UTC (rev 4593)
@@ -844,7 +844,42 @@
 		return $this->collResponsables;
 	}
 
+
 	
+	public function getResponsablesJoinRolResponsable($criteria = null, $con = null)
+	{
+				include_once 'lib/model/om/BaseResponsablePeer.php';
+		if ($criteria === null) {
+			$criteria = new Criteria();
+		}
+		elseif ($criteria instanceof Criteria)
+		{
+			$criteria = clone $criteria;
+		}
+
+		if ($this->collResponsables === null) {
+			if ($this->isNew()) {
+				$this->collResponsables = array();
+			} else {
+
+				$criteria->add(ResponsablePeer::FK_TIPODOCUMENTO_ID, $this->getId());
+
+				$this->collResponsables = ResponsablePeer::doSelectJoinRolResponsable($criteria, $con);
+			}
+		} else {
+									
+			$criteria->add(ResponsablePeer::FK_TIPODOCUMENTO_ID, $this->getId());
+
+			if (!isset($this->lastResponsableCriteria) || !$this->lastResponsableCriteria->equals($criteria)) {
+				$this->collResponsables = ResponsablePeer::doSelectJoinRolResponsable($criteria, $con);
+			}
+		}
+		$this->lastResponsableCriteria = $criteria;
+
+		return $this->collResponsables;
+	}
+
+	
 	public function initDocentes()
 	{
 		if ($this->collDocentes === null) {




Más información sobre la lista de distribución Alba-desarrollo