[Alba-desarrollo] SVN Alba r4597 - in prosistem/alba/trunk/alba:
config data/sql lib/model/map lib/model/om
commits en pressenter.com.ar
commits en pressenter.com.ar
Lun Abr 30 22:29:25 CEST 2007
Author: hsanchez
Date: 2007-04-30 17:29:21 -0300 (Mon, 30 Apr 2007)
New Revision: 4597
Modified:
prosistem/alba/trunk/alba/config/schema.xml
prosistem/alba/trunk/alba/data/sql/actualizacion_1.0rc_a_1.0.sql
prosistem/alba/trunk/alba/data/sql/schema.sql
prosistem/alba/trunk/alba/lib/model/map/RelRolresponsableResponsableMapBuilder.php
prosistem/alba/trunk/alba/lib/model/om/BaseAlumno.php
prosistem/alba/trunk/alba/lib/model/om/BaseRelRolresponsableResponsable.php
prosistem/alba/trunk/alba/lib/model/om/BaseRelRolresponsableResponsablePeer.php
prosistem/alba/trunk/alba/lib/model/om/BaseResponsable.php
prosistem/alba/trunk/alba/lib/model/om/BaseRolResponsable.php
Log:
Agregando fk_alumno_id a la relacion de roles y responsables, genere el nuevo modelo
Modified: prosistem/alba/trunk/alba/config/schema.xml
===================================================================
--- prosistem/alba/trunk/alba/config/schema.xml 2007-04-30 20:15:24 UTC (rev 4596)
+++ prosistem/alba/trunk/alba/config/schema.xml 2007-04-30 20:29:21 UTC (rev 4597)
@@ -749,6 +749,7 @@
<column name="id" type="INTEGER" size="11" required="true" autoIncrement="true" primaryKey="true"/>
<column name="fk_rolresponsable_id" type="INTEGER" size="11" required="true" default="0"/>
<column name="fk_responsable_id" type="INTEGER" size="11" required="true" default="0"/>
+ <column name="fk_alumno_id" type="INTEGER" size="11" required="true" default="0"/>
<column name="descripcion" type="VARCHAR" size="255" default=""/>
<foreign-key foreignTable="rol_responsable">
<reference local="fk_rolresponsable_id" foreign="id"/>
@@ -756,5 +757,8 @@
<foreign-key foreignTable="responsable">
<reference local="fk_responsable_id" foreign="id"/>
</foreign-key>
+ <foreign-key foreignTable="alumno">
+ <reference local="fk_alumno_id" foreign="id"/>
+ </foreign-key>
</table>
</database>
\ No newline at end of file
Modified: prosistem/alba/trunk/alba/data/sql/actualizacion_1.0rc_a_1.0.sql
===================================================================
--- prosistem/alba/trunk/alba/data/sql/actualizacion_1.0rc_a_1.0.sql 2007-04-30 20:15:24 UTC (rev 4596)
+++ prosistem/alba/trunk/alba/data/sql/actualizacion_1.0rc_a_1.0.sql 2007-04-30 20:29:21 UTC (rev 4597)
@@ -43,7 +43,8 @@
(
`id` INTEGER NOT NULL AUTO_INCREMENT,
`fk_rolresponsable_id` INTEGER default 0 NOT NULL,
- `fk_responsable_id` INTEGER default 0 NOT NULL,
+ `fk_responsable_id` INTEGER default 0 NOT NULL,
+ `fk_alumno_id` INTEGER default 0 NOT NULL,
`descripcion` VARCHAR(255) default "" NOT NULL,
PRIMARY KEY (`id`),
INDEX `rel_rolresponsable_responsable_FI_1` (`fk_rolresponsable_id`),
@@ -53,7 +54,11 @@
INDEX `rel_rolresponsable_responsable_FI_2` (`fk_responsable_id`),
CONSTRAINT `rel_rolresponsable_responsable_FK_2`
FOREIGN KEY (`fk_responsable_id`)
- REFERENCES `responsable` (`id`)
+ REFERENCES `responsable` (`id`),
+ INDEX `rel_rolresponsable_responsable_FI_3` (`fk_alumno_id`),
+ CONSTRAINT `rel_rolresponsable_responsable_FK_3`
+ FOREIGN KEY (`fk_alumno_id`)
+ REFERENCES `alumno` (`id`)
)Type=InnoDB;
ALTER TABLE responsable ADD COLUMN fk_rolresponsable_id INT NOT NULL DEFAULT 1;
Modified: prosistem/alba/trunk/alba/data/sql/schema.sql
===================================================================
--- prosistem/alba/trunk/alba/data/sql/schema.sql 2007-04-30 20:15:24 UTC (rev 4596)
+++ prosistem/alba/trunk/alba/data/sql/schema.sql 2007-04-30 20:29:21 UTC (rev 4597)
@@ -1430,6 +1430,7 @@
`id` INTEGER(11) NOT NULL AUTO_INCREMENT,
`fk_rolresponsable_id` INTEGER(11) default 0 NOT NULL,
`fk_responsable_id` INTEGER(11) default 0 NOT NULL,
+ `fk_alumno_id` INTEGER(11) default 0 NOT NULL,
`descripcion` VARCHAR(255) default '',
PRIMARY KEY (`id`),
INDEX `rel_rolresponsable_responsable_FI_1` (`fk_rolresponsable_id`),
@@ -1439,7 +1440,11 @@
INDEX `rel_rolresponsable_responsable_FI_2` (`fk_responsable_id`),
CONSTRAINT `rel_rolresponsable_responsable_FK_2`
FOREIGN KEY (`fk_responsable_id`)
- REFERENCES `responsable` (`id`)
+ REFERENCES `responsable` (`id`),
+ INDEX `rel_rolresponsable_responsable_FI_3` (`fk_alumno_id`),
+ CONSTRAINT `rel_rolresponsable_responsable_FK_3`
+ FOREIGN KEY (`fk_alumno_id`)
+ REFERENCES `alumno` (`id`)
)Type=InnoDB;
# This restores the fkey checks, after having unset them earlier
Modified: prosistem/alba/trunk/alba/lib/model/map/RelRolresponsableResponsableMapBuilder.php
===================================================================
--- prosistem/alba/trunk/alba/lib/model/map/RelRolresponsableResponsableMapBuilder.php 2007-04-30 20:15:24 UTC (rev 4596)
+++ prosistem/alba/trunk/alba/lib/model/map/RelRolresponsableResponsableMapBuilder.php 2007-04-30 20:29:21 UTC (rev 4597)
@@ -38,6 +38,8 @@
$tMap->addForeignKey('FK_RESPONSABLE_ID', 'FkResponsableId', 'int', CreoleTypes::INTEGER, 'responsable', 'ID', true, 11);
+ $tMap->addForeignKey('FK_ALUMNO_ID', 'FkAlumnoId', 'int', CreoleTypes::INTEGER, 'alumno', 'ID', true, 11);
+
$tMap->addColumn('DESCRIPCION', 'Descripcion', 'string', CreoleTypes::VARCHAR, false, 255);
}
Modified: prosistem/alba/trunk/alba/lib/model/om/BaseAlumno.php
===================================================================
--- prosistem/alba/trunk/alba/lib/model/om/BaseAlumno.php 2007-04-30 20:15:24 UTC (rev 4596)
+++ prosistem/alba/trunk/alba/lib/model/om/BaseAlumno.php 2007-04-30 20:29:21 UTC (rev 4597)
@@ -160,6 +160,12 @@
protected $lastRelAlumnoDivisionCriteria = null;
+ protected $collRelRolresponsableResponsables;
+
+
+ protected $lastRelRolresponsableResponsableCriteria = null;
+
+
protected $alreadyInSave = false;
@@ -825,6 +831,14 @@
}
}
+ if ($this->collRelRolresponsableResponsables !== null) {
+ foreach($this->collRelRolresponsableResponsables as $referrerFK) {
+ if (!$referrerFK->isDeleted()) {
+ $affectedRows += $referrerFK->save($con);
+ }
+ }
+ }
+
$this->alreadyInSave = false;
}
return $affectedRows;
@@ -960,7 +974,15 @@
}
}
+ if ($this->collRelRolresponsableResponsables !== null) {
+ foreach($this->collRelRolresponsableResponsables as $referrerFK) {
+ if (!$referrerFK->validate($columns)) {
+ $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
+ }
+ }
+ }
+
$this->alreadyInValidation = false;
}
@@ -1330,6 +1352,10 @@
$copyObj->addRelAlumnoDivision($relObj->copy($deepCopy));
}
+ foreach($this->getRelRolresponsableResponsables() as $relObj) {
+ $copyObj->addRelRolresponsableResponsable($relObj->copy($deepCopy));
+ }
+
}
$copyObj->setNew(true);
@@ -2515,4 +2541,144 @@
return $this->collRelAlumnoDivisions;
}
+
+ public function initRelRolresponsableResponsables()
+ {
+ if ($this->collRelRolresponsableResponsables === null) {
+ $this->collRelRolresponsableResponsables = array();
+ }
+ }
+
+
+ public function getRelRolresponsableResponsables($criteria = null, $con = null)
+ {
+ include_once 'lib/model/om/BaseRelRolresponsableResponsablePeer.php';
+ if ($criteria === null) {
+ $criteria = new Criteria();
+ }
+ elseif ($criteria instanceof Criteria)
+ {
+ $criteria = clone $criteria;
+ }
+
+ if ($this->collRelRolresponsableResponsables === null) {
+ if ($this->isNew()) {
+ $this->collRelRolresponsableResponsables = array();
+ } else {
+
+ $criteria->add(RelRolresponsableResponsablePeer::FK_ALUMNO_ID, $this->getId());
+
+ RelRolresponsableResponsablePeer::addSelectColumns($criteria);
+ $this->collRelRolresponsableResponsables = RelRolresponsableResponsablePeer::doSelect($criteria, $con);
+ }
+ } else {
+ if (!$this->isNew()) {
+
+
+ $criteria->add(RelRolresponsableResponsablePeer::FK_ALUMNO_ID, $this->getId());
+
+ RelRolresponsableResponsablePeer::addSelectColumns($criteria);
+ if (!isset($this->lastRelRolresponsableResponsableCriteria) || !$this->lastRelRolresponsableResponsableCriteria->equals($criteria)) {
+ $this->collRelRolresponsableResponsables = RelRolresponsableResponsablePeer::doSelect($criteria, $con);
+ }
+ }
+ }
+ $this->lastRelRolresponsableResponsableCriteria = $criteria;
+ return $this->collRelRolresponsableResponsables;
+ }
+
+
+ public function countRelRolresponsableResponsables($criteria = null, $distinct = false, $con = null)
+ {
+ include_once 'lib/model/om/BaseRelRolresponsableResponsablePeer.php';
+ if ($criteria === null) {
+ $criteria = new Criteria();
+ }
+ elseif ($criteria instanceof Criteria)
+ {
+ $criteria = clone $criteria;
+ }
+
+ $criteria->add(RelRolresponsableResponsablePeer::FK_ALUMNO_ID, $this->getId());
+
+ return RelRolresponsableResponsablePeer::doCount($criteria, $distinct, $con);
+ }
+
+
+ public function addRelRolresponsableResponsable(RelRolresponsableResponsable $l)
+ {
+ $this->collRelRolresponsableResponsables[] = $l;
+ $l->setAlumno($this);
+ }
+
+
+
+ public function getRelRolresponsableResponsablesJoinRolResponsable($criteria = null, $con = null)
+ {
+ include_once 'lib/model/om/BaseRelRolresponsableResponsablePeer.php';
+ if ($criteria === null) {
+ $criteria = new Criteria();
+ }
+ elseif ($criteria instanceof Criteria)
+ {
+ $criteria = clone $criteria;
+ }
+
+ if ($this->collRelRolresponsableResponsables === null) {
+ if ($this->isNew()) {
+ $this->collRelRolresponsableResponsables = array();
+ } else {
+
+ $criteria->add(RelRolresponsableResponsablePeer::FK_ALUMNO_ID, $this->getId());
+
+ $this->collRelRolresponsableResponsables = RelRolresponsableResponsablePeer::doSelectJoinRolResponsable($criteria, $con);
+ }
+ } else {
+
+ $criteria->add(RelRolresponsableResponsablePeer::FK_ALUMNO_ID, $this->getId());
+
+ if (!isset($this->lastRelRolresponsableResponsableCriteria) || !$this->lastRelRolresponsableResponsableCriteria->equals($criteria)) {
+ $this->collRelRolresponsableResponsables = RelRolresponsableResponsablePeer::doSelectJoinRolResponsable($criteria, $con);
+ }
+ }
+ $this->lastRelRolresponsableResponsableCriteria = $criteria;
+
+ return $this->collRelRolresponsableResponsables;
+ }
+
+
+
+ public function getRelRolresponsableResponsablesJoinResponsable($criteria = null, $con = null)
+ {
+ include_once 'lib/model/om/BaseRelRolresponsableResponsablePeer.php';
+ if ($criteria === null) {
+ $criteria = new Criteria();
+ }
+ elseif ($criteria instanceof Criteria)
+ {
+ $criteria = clone $criteria;
+ }
+
+ if ($this->collRelRolresponsableResponsables === null) {
+ if ($this->isNew()) {
+ $this->collRelRolresponsableResponsables = array();
+ } else {
+
+ $criteria->add(RelRolresponsableResponsablePeer::FK_ALUMNO_ID, $this->getId());
+
+ $this->collRelRolresponsableResponsables = RelRolresponsableResponsablePeer::doSelectJoinResponsable($criteria, $con);
+ }
+ } else {
+
+ $criteria->add(RelRolresponsableResponsablePeer::FK_ALUMNO_ID, $this->getId());
+
+ if (!isset($this->lastRelRolresponsableResponsableCriteria) || !$this->lastRelRolresponsableResponsableCriteria->equals($criteria)) {
+ $this->collRelRolresponsableResponsables = RelRolresponsableResponsablePeer::doSelectJoinResponsable($criteria, $con);
+ }
+ }
+ $this->lastRelRolresponsableResponsableCriteria = $criteria;
+
+ return $this->collRelRolresponsableResponsables;
+ }
+
}
\ No newline at end of file
Modified: prosistem/alba/trunk/alba/lib/model/om/BaseRelRolresponsableResponsable.php
===================================================================
--- prosistem/alba/trunk/alba/lib/model/om/BaseRelRolresponsableResponsable.php 2007-04-30 20:15:24 UTC (rev 4596)
+++ prosistem/alba/trunk/alba/lib/model/om/BaseRelRolresponsableResponsable.php 2007-04-30 20:29:21 UTC (rev 4597)
@@ -21,6 +21,10 @@
+ protected $fk_alumno_id = 0;
+
+
+
protected $descripcion = '';
@@ -30,6 +34,9 @@
protected $aResponsable;
+ protected $aAlumno;
+
+
protected $alreadyInSave = false;
@@ -57,6 +64,13 @@
}
+ public function getFkAlumnoId()
+ {
+
+ return $this->fk_alumno_id;
+ }
+
+
public function getDescripcion()
{
@@ -102,6 +116,20 @@
}
+ public function setFkAlumnoId($v)
+ {
+
+ if ($this->fk_alumno_id !== $v || $v === 0) {
+ $this->fk_alumno_id = $v;
+ $this->modifiedColumns[] = RelRolresponsableResponsablePeer::FK_ALUMNO_ID;
+ }
+
+ if ($this->aAlumno !== null && $this->aAlumno->getId() !== $v) {
+ $this->aAlumno = null;
+ }
+
+ }
+
public function setDescripcion($v)
{
@@ -122,13 +150,15 @@
$this->fk_responsable_id = $rs->getInt($startcol + 2);
- $this->descripcion = $rs->getString($startcol + 3);
+ $this->fk_alumno_id = $rs->getInt($startcol + 3);
+ $this->descripcion = $rs->getString($startcol + 4);
+
$this->resetModified();
$this->setNew(false);
- return $startcol + 4;
+ return $startcol + 5;
} catch (Exception $e) {
throw new PropelException("Error populating RelRolresponsableResponsable object", $e);
}
@@ -200,7 +230,14 @@
$this->setResponsable($this->aResponsable);
}
+ if ($this->aAlumno !== null) {
+ if ($this->aAlumno->isModified()) {
+ $affectedRows += $this->aAlumno->save($con);
+ }
+ $this->setAlumno($this->aAlumno);
+ }
+
if ($this->isModified()) {
if ($this->isNew()) {
$pk = RelRolresponsableResponsablePeer::doInsert($this, $con);
@@ -261,7 +298,13 @@
}
}
+ if ($this->aAlumno !== null) {
+ if (!$this->aAlumno->validate($columns)) {
+ $failureMap = array_merge($failureMap, $this->aAlumno->getValidationFailures());
+ }
+ }
+
if (($retval = RelRolresponsableResponsablePeer::doValidate($this, $columns)) !== true) {
$failureMap = array_merge($failureMap, $retval);
}
@@ -295,6 +338,9 @@
return $this->getFkResponsableId();
break;
case 3:
+ return $this->getFkAlumnoId();
+ break;
+ case 4:
return $this->getDescripcion();
break;
default:
@@ -310,7 +356,8 @@
$keys[0] => $this->getId(),
$keys[1] => $this->getFkRolresponsableId(),
$keys[2] => $this->getFkResponsableId(),
- $keys[3] => $this->getDescripcion(),
+ $keys[3] => $this->getFkAlumnoId(),
+ $keys[4] => $this->getDescripcion(),
);
return $result;
}
@@ -336,6 +383,9 @@
$this->setFkResponsableId($value);
break;
case 3:
+ $this->setFkAlumnoId($value);
+ break;
+ case 4:
$this->setDescripcion($value);
break;
} }
@@ -348,7 +398,8 @@
if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]);
if (array_key_exists($keys[1], $arr)) $this->setFkRolresponsableId($arr[$keys[1]]);
if (array_key_exists($keys[2], $arr)) $this->setFkResponsableId($arr[$keys[2]]);
- if (array_key_exists($keys[3], $arr)) $this->setDescripcion($arr[$keys[3]]);
+ if (array_key_exists($keys[3], $arr)) $this->setFkAlumnoId($arr[$keys[3]]);
+ if (array_key_exists($keys[4], $arr)) $this->setDescripcion($arr[$keys[4]]);
}
@@ -359,6 +410,7 @@
if ($this->isColumnModified(RelRolresponsableResponsablePeer::ID)) $criteria->add(RelRolresponsableResponsablePeer::ID, $this->id);
if ($this->isColumnModified(RelRolresponsableResponsablePeer::FK_ROLRESPONSABLE_ID)) $criteria->add(RelRolresponsableResponsablePeer::FK_ROLRESPONSABLE_ID, $this->fk_rolresponsable_id);
if ($this->isColumnModified(RelRolresponsableResponsablePeer::FK_RESPONSABLE_ID)) $criteria->add(RelRolresponsableResponsablePeer::FK_RESPONSABLE_ID, $this->fk_responsable_id);
+ if ($this->isColumnModified(RelRolresponsableResponsablePeer::FK_ALUMNO_ID)) $criteria->add(RelRolresponsableResponsablePeer::FK_ALUMNO_ID, $this->fk_alumno_id);
if ($this->isColumnModified(RelRolresponsableResponsablePeer::DESCRIPCION)) $criteria->add(RelRolresponsableResponsablePeer::DESCRIPCION, $this->descripcion);
return $criteria;
@@ -394,6 +446,8 @@
$copyObj->setFkResponsableId($this->fk_responsable_id);
+ $copyObj->setFkAlumnoId($this->fk_alumno_id);
+
$copyObj->setDescripcion($this->descripcion);
@@ -480,4 +534,34 @@
return $this->aResponsable;
}
+
+ public function setAlumno($v)
+ {
+
+
+ if ($v === null) {
+ $this->setFkAlumnoId('0');
+ } else {
+ $this->setFkAlumnoId($v->getId());
+ }
+
+
+ $this->aAlumno = $v;
+ }
+
+
+
+ public function getAlumno($con = null)
+ {
+ include_once 'lib/model/om/BaseAlumnoPeer.php';
+
+ if ($this->aAlumno === null && ($this->fk_alumno_id !== null)) {
+
+ $this->aAlumno = AlumnoPeer::retrieveByPK($this->fk_alumno_id, $con);
+
+
+ }
+ return $this->aAlumno;
+ }
+
}
\ No newline at end of file
Modified: prosistem/alba/trunk/alba/lib/model/om/BaseRelRolresponsableResponsablePeer.php
===================================================================
--- prosistem/alba/trunk/alba/lib/model/om/BaseRelRolresponsableResponsablePeer.php 2007-04-30 20:15:24 UTC (rev 4596)
+++ prosistem/alba/trunk/alba/lib/model/om/BaseRelRolresponsableResponsablePeer.php 2007-04-30 20:29:21 UTC (rev 4597)
@@ -13,7 +13,7 @@
const CLASS_DEFAULT = 'lib.model.RelRolresponsableResponsable';
- const NUM_COLUMNS = 4;
+ const NUM_COLUMNS = 5;
const NUM_LAZY_LOAD_COLUMNS = 0;
@@ -29,6 +29,9 @@
const FK_RESPONSABLE_ID = 'rel_rolresponsable_responsable.FK_RESPONSABLE_ID';
+ const FK_ALUMNO_ID = 'rel_rolresponsable_responsable.FK_ALUMNO_ID';
+
+
const DESCRIPCION = 'rel_rolresponsable_responsable.DESCRIPCION';
@@ -37,18 +40,18 @@
private static $fieldNames = array (
- BasePeer::TYPE_PHPNAME => array ('Id', 'FkRolresponsableId', 'FkResponsableId', 'Descripcion', ),
- BasePeer::TYPE_COLNAME => array (RelRolresponsableResponsablePeer::ID, RelRolresponsableResponsablePeer::FK_ROLRESPONSABLE_ID, RelRolresponsableResponsablePeer::FK_RESPONSABLE_ID, RelRolresponsableResponsablePeer::DESCRIPCION, ),
- BasePeer::TYPE_FIELDNAME => array ('id', 'fk_rolresponsable_id', 'fk_responsable_id', 'descripcion', ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, )
+ BasePeer::TYPE_PHPNAME => array ('Id', 'FkRolresponsableId', 'FkResponsableId', 'FkAlumnoId', 'Descripcion', ),
+ BasePeer::TYPE_COLNAME => array (RelRolresponsableResponsablePeer::ID, RelRolresponsableResponsablePeer::FK_ROLRESPONSABLE_ID, RelRolresponsableResponsablePeer::FK_RESPONSABLE_ID, RelRolresponsableResponsablePeer::FK_ALUMNO_ID, RelRolresponsableResponsablePeer::DESCRIPCION, ),
+ BasePeer::TYPE_FIELDNAME => array ('id', 'fk_rolresponsable_id', 'fk_responsable_id', 'fk_alumno_id', 'descripcion', ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, )
);
private static $fieldKeys = array (
- BasePeer::TYPE_PHPNAME => array ('Id' => 0, 'FkRolresponsableId' => 1, 'FkResponsableId' => 2, 'Descripcion' => 3, ),
- BasePeer::TYPE_COLNAME => array (RelRolresponsableResponsablePeer::ID => 0, RelRolresponsableResponsablePeer::FK_ROLRESPONSABLE_ID => 1, RelRolresponsableResponsablePeer::FK_RESPONSABLE_ID => 2, RelRolresponsableResponsablePeer::DESCRIPCION => 3, ),
- BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'fk_rolresponsable_id' => 1, 'fk_responsable_id' => 2, 'descripcion' => 3, ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, )
+ BasePeer::TYPE_PHPNAME => array ('Id' => 0, 'FkRolresponsableId' => 1, 'FkResponsableId' => 2, 'FkAlumnoId' => 3, 'Descripcion' => 4, ),
+ BasePeer::TYPE_COLNAME => array (RelRolresponsableResponsablePeer::ID => 0, RelRolresponsableResponsablePeer::FK_ROLRESPONSABLE_ID => 1, RelRolresponsableResponsablePeer::FK_RESPONSABLE_ID => 2, RelRolresponsableResponsablePeer::FK_ALUMNO_ID => 3, RelRolresponsableResponsablePeer::DESCRIPCION => 4, ),
+ BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'fk_rolresponsable_id' => 1, 'fk_responsable_id' => 2, 'fk_alumno_id' => 3, 'descripcion' => 4, ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, )
);
@@ -108,6 +111,8 @@
$criteria->addSelectColumn(RelRolresponsableResponsablePeer::FK_RESPONSABLE_ID);
+ $criteria->addSelectColumn(RelRolresponsableResponsablePeer::FK_ALUMNO_ID);
+
$criteria->addSelectColumn(RelRolresponsableResponsablePeer::DESCRIPCION);
}
@@ -245,6 +250,34 @@
+ public static function doCountJoinAlumno(Criteria $criteria, $distinct = false, $con = null)
+ {
+ $criteria = clone $criteria;
+
+ $criteria->clearSelectColumns()->clearOrderByColumns();
+ if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
+ $criteria->addSelectColumn(RelRolresponsableResponsablePeer::COUNT_DISTINCT);
+ } else {
+ $criteria->addSelectColumn(RelRolresponsableResponsablePeer::COUNT);
+ }
+
+ foreach($criteria->getGroupByColumns() as $column)
+ {
+ $criteria->addSelectColumn($column);
+ }
+
+ $criteria->addJoin(RelRolresponsableResponsablePeer::FK_ALUMNO_ID, AlumnoPeer::ID);
+
+ $rs = RelRolresponsableResponsablePeer::doSelectRS($criteria, $con);
+ if ($rs->next()) {
+ return $rs->getInt(1);
+ } else {
+ return 0;
+ }
+ }
+
+
+
public static function doSelectJoinRolResponsable(Criteria $c, $con = null)
{
$c = clone $c;
@@ -339,6 +372,53 @@
+ public static function doSelectJoinAlumno(Criteria $c, $con = null)
+ {
+ $c = clone $c;
+
+ if ($c->getDbName() == Propel::getDefaultDB()) {
+ $c->setDbName(self::DATABASE_NAME);
+ }
+
+ RelRolresponsableResponsablePeer::addSelectColumns($c);
+ $startcol = (RelRolresponsableResponsablePeer::NUM_COLUMNS - RelRolresponsableResponsablePeer::NUM_LAZY_LOAD_COLUMNS) + 1;
+ AlumnoPeer::addSelectColumns($c);
+
+ $c->addJoin(RelRolresponsableResponsablePeer::FK_ALUMNO_ID, AlumnoPeer::ID);
+ $rs = BasePeer::doSelect($c, $con);
+ $results = array();
+
+ while($rs->next()) {
+
+ $omClass = RelRolresponsableResponsablePeer::getOMClass();
+
+ $cls = Propel::import($omClass);
+ $obj1 = new $cls();
+ $obj1->hydrate($rs);
+
+ $omClass = AlumnoPeer::getOMClass();
+
+ $cls = Propel::import($omClass);
+ $obj2 = new $cls();
+ $obj2->hydrate($rs, $startcol);
+
+ $newObject = true;
+ foreach($results as $temp_obj1) {
+ $temp_obj2 = $temp_obj1->getAlumno(); if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
+ $newObject = false;
+ $temp_obj2->addRelRolresponsableResponsable($obj1); break;
+ }
+ }
+ if ($newObject) {
+ $obj2->initRelRolresponsableResponsables();
+ $obj2->addRelRolresponsableResponsable($obj1); }
+ $results[] = $obj1;
+ }
+ return $results;
+ }
+
+
+
public static function doCountJoinAll(Criteria $criteria, $distinct = false, $con = null)
{
$criteria = clone $criteria;
@@ -359,6 +439,8 @@
$criteria->addJoin(RelRolresponsableResponsablePeer::FK_RESPONSABLE_ID, ResponsablePeer::ID);
+ $criteria->addJoin(RelRolresponsableResponsablePeer::FK_ALUMNO_ID, AlumnoPeer::ID);
+
$rs = RelRolresponsableResponsablePeer::doSelectRS($criteria, $con);
if ($rs->next()) {
return $rs->getInt(1);
@@ -386,10 +468,15 @@
ResponsablePeer::addSelectColumns($c);
$startcol4 = $startcol3 + ResponsablePeer::NUM_COLUMNS;
+ AlumnoPeer::addSelectColumns($c);
+ $startcol5 = $startcol4 + AlumnoPeer::NUM_COLUMNS;
+
$c->addJoin(RelRolresponsableResponsablePeer::FK_ROLRESPONSABLE_ID, RolResponsablePeer::ID);
$c->addJoin(RelRolresponsableResponsablePeer::FK_RESPONSABLE_ID, ResponsablePeer::ID);
+ $c->addJoin(RelRolresponsableResponsablePeer::FK_ALUMNO_ID, AlumnoPeer::ID);
+
$rs = BasePeer::doSelect($c, $con);
$results = array();
@@ -448,6 +535,29 @@
$obj3->addRelRolresponsableResponsable($obj1);
}
+
+
+ $omClass = AlumnoPeer::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->getAlumno(); if ($temp_obj4->getPrimaryKey() === $obj4->getPrimaryKey()) {
+ $newObject = false;
+ $temp_obj4->addRelRolresponsableResponsable($obj1); break;
+ }
+ }
+
+ if ($newObject) {
+ $obj4->initRelRolresponsableResponsables();
+ $obj4->addRelRolresponsableResponsable($obj1);
+ }
+
$results[] = $obj1;
}
return $results;
@@ -473,6 +583,8 @@
$criteria->addJoin(RelRolresponsableResponsablePeer::FK_RESPONSABLE_ID, ResponsablePeer::ID);
+ $criteria->addJoin(RelRolresponsableResponsablePeer::FK_ALUMNO_ID, AlumnoPeer::ID);
+
$rs = RelRolresponsableResponsablePeer::doSelectRS($criteria, $con);
if ($rs->next()) {
return $rs->getInt(1);
@@ -501,6 +613,8 @@
$criteria->addJoin(RelRolresponsableResponsablePeer::FK_ROLRESPONSABLE_ID, RolResponsablePeer::ID);
+ $criteria->addJoin(RelRolresponsableResponsablePeer::FK_ALUMNO_ID, AlumnoPeer::ID);
+
$rs = RelRolresponsableResponsablePeer::doSelectRS($criteria, $con);
if ($rs->next()) {
return $rs->getInt(1);
@@ -511,6 +625,36 @@
+ public static function doCountJoinAllExceptAlumno(Criteria $criteria, $distinct = false, $con = null)
+ {
+ $criteria = clone $criteria;
+
+ $criteria->clearSelectColumns()->clearOrderByColumns();
+ if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
+ $criteria->addSelectColumn(RelRolresponsableResponsablePeer::COUNT_DISTINCT);
+ } else {
+ $criteria->addSelectColumn(RelRolresponsableResponsablePeer::COUNT);
+ }
+
+ foreach($criteria->getGroupByColumns() as $column)
+ {
+ $criteria->addSelectColumn($column);
+ }
+
+ $criteria->addJoin(RelRolresponsableResponsablePeer::FK_ROLRESPONSABLE_ID, RolResponsablePeer::ID);
+
+ $criteria->addJoin(RelRolresponsableResponsablePeer::FK_RESPONSABLE_ID, ResponsablePeer::ID);
+
+ $rs = RelRolresponsableResponsablePeer::doSelectRS($criteria, $con);
+ if ($rs->next()) {
+ return $rs->getInt(1);
+ } else {
+ return 0;
+ }
+ }
+
+
+
public static function doSelectJoinAllExceptRolResponsable(Criteria $c, $con = null)
{
$c = clone $c;
@@ -525,9 +669,14 @@
ResponsablePeer::addSelectColumns($c);
$startcol3 = $startcol2 + ResponsablePeer::NUM_COLUMNS;
+ AlumnoPeer::addSelectColumns($c);
+ $startcol4 = $startcol3 + AlumnoPeer::NUM_COLUMNS;
+
$c->addJoin(RelRolresponsableResponsablePeer::FK_RESPONSABLE_ID, ResponsablePeer::ID);
+ $c->addJoin(RelRolresponsableResponsablePeer::FK_ALUMNO_ID, AlumnoPeer::ID);
+
$rs = BasePeer::doSelect($c, $con);
$results = array();
@@ -561,6 +710,28 @@
$obj2->addRelRolresponsableResponsable($obj1);
}
+ $omClass = AlumnoPeer::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->getAlumno(); if ($temp_obj3->getPrimaryKey() === $obj3->getPrimaryKey()) {
+ $newObject = false;
+ $temp_obj3->addRelRolresponsableResponsable($obj1);
+ break;
+ }
+ }
+
+ if ($newObject) {
+ $obj3->initRelRolresponsableResponsables();
+ $obj3->addRelRolresponsableResponsable($obj1);
+ }
+
$results[] = $obj1;
}
return $results;
@@ -582,9 +753,14 @@
RolResponsablePeer::addSelectColumns($c);
$startcol3 = $startcol2 + RolResponsablePeer::NUM_COLUMNS;
+ AlumnoPeer::addSelectColumns($c);
+ $startcol4 = $startcol3 + AlumnoPeer::NUM_COLUMNS;
+
$c->addJoin(RelRolresponsableResponsablePeer::FK_ROLRESPONSABLE_ID, RolResponsablePeer::ID);
+ $c->addJoin(RelRolresponsableResponsablePeer::FK_ALUMNO_ID, AlumnoPeer::ID);
+
$rs = BasePeer::doSelect($c, $con);
$results = array();
@@ -618,12 +794,118 @@
$obj2->addRelRolresponsableResponsable($obj1);
}
+ $omClass = AlumnoPeer::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->getAlumno(); if ($temp_obj3->getPrimaryKey() === $obj3->getPrimaryKey()) {
+ $newObject = false;
+ $temp_obj3->addRelRolresponsableResponsable($obj1);
+ break;
+ }
+ }
+
+ if ($newObject) {
+ $obj3->initRelRolresponsableResponsables();
+ $obj3->addRelRolresponsableResponsable($obj1);
+ }
+
$results[] = $obj1;
}
return $results;
}
+
+ public static function doSelectJoinAllExceptAlumno(Criteria $c, $con = null)
+ {
+ $c = clone $c;
+
+ if ($c->getDbName() == Propel::getDefaultDB()) {
+ $c->setDbName(self::DATABASE_NAME);
+ }
+
+ RelRolresponsableResponsablePeer::addSelectColumns($c);
+ $startcol2 = (RelRolresponsableResponsablePeer::NUM_COLUMNS - RelRolresponsableResponsablePeer::NUM_LAZY_LOAD_COLUMNS) + 1;
+
+ RolResponsablePeer::addSelectColumns($c);
+ $startcol3 = $startcol2 + RolResponsablePeer::NUM_COLUMNS;
+
+ ResponsablePeer::addSelectColumns($c);
+ $startcol4 = $startcol3 + ResponsablePeer::NUM_COLUMNS;
+
+ $c->addJoin(RelRolresponsableResponsablePeer::FK_ROLRESPONSABLE_ID, RolResponsablePeer::ID);
+
+ $c->addJoin(RelRolresponsableResponsablePeer::FK_RESPONSABLE_ID, ResponsablePeer::ID);
+
+
+ $rs = BasePeer::doSelect($c, $con);
+ $results = array();
+
+ while($rs->next()) {
+
+ $omClass = RelRolresponsableResponsablePeer::getOMClass();
+
+ $cls = Propel::import($omClass);
+ $obj1 = new $cls();
+ $obj1->hydrate($rs);
+
+ $omClass = RolResponsablePeer::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->getRolResponsable(); if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
+ $newObject = false;
+ $temp_obj2->addRelRolresponsableResponsable($obj1);
+ break;
+ }
+ }
+
+ if ($newObject) {
+ $obj2->initRelRolresponsableResponsables();
+ $obj2->addRelRolresponsableResponsable($obj1);
+ }
+
+ $omClass = ResponsablePeer::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->getResponsable(); if ($temp_obj3->getPrimaryKey() === $obj3->getPrimaryKey()) {
+ $newObject = false;
+ $temp_obj3->addRelRolresponsableResponsable($obj1);
+ break;
+ }
+ }
+
+ if ($newObject) {
+ $obj3->initRelRolresponsableResponsables();
+ $obj3->addRelRolresponsableResponsable($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/BaseResponsable.php
===================================================================
--- prosistem/alba/trunk/alba/lib/model/om/BaseResponsable.php 2007-04-30 20:15:24 UTC (rev 4596)
+++ prosistem/alba/trunk/alba/lib/model/om/BaseResponsable.php 2007-04-30 20:29:21 UTC (rev 4597)
@@ -1192,4 +1192,39 @@
return $this->collRelRolresponsableResponsables;
}
+
+
+ public function getRelRolresponsableResponsablesJoinAlumno($criteria = null, $con = null)
+ {
+ include_once 'lib/model/om/BaseRelRolresponsableResponsablePeer.php';
+ if ($criteria === null) {
+ $criteria = new Criteria();
+ }
+ elseif ($criteria instanceof Criteria)
+ {
+ $criteria = clone $criteria;
+ }
+
+ if ($this->collRelRolresponsableResponsables === null) {
+ if ($this->isNew()) {
+ $this->collRelRolresponsableResponsables = array();
+ } else {
+
+ $criteria->add(RelRolresponsableResponsablePeer::FK_RESPONSABLE_ID, $this->getId());
+
+ $this->collRelRolresponsableResponsables = RelRolresponsableResponsablePeer::doSelectJoinAlumno($criteria, $con);
+ }
+ } else {
+
+ $criteria->add(RelRolresponsableResponsablePeer::FK_RESPONSABLE_ID, $this->getId());
+
+ if (!isset($this->lastRelRolresponsableResponsableCriteria) || !$this->lastRelRolresponsableResponsableCriteria->equals($criteria)) {
+ $this->collRelRolresponsableResponsables = RelRolresponsableResponsablePeer::doSelectJoinAlumno($criteria, $con);
+ }
+ }
+ $this->lastRelRolresponsableResponsableCriteria = $criteria;
+
+ return $this->collRelRolresponsableResponsables;
+ }
+
}
\ No newline at end of file
Modified: prosistem/alba/trunk/alba/lib/model/om/BaseRolResponsable.php
===================================================================
--- prosistem/alba/trunk/alba/lib/model/om/BaseRolResponsable.php 2007-04-30 20:15:24 UTC (rev 4596)
+++ prosistem/alba/trunk/alba/lib/model/om/BaseRolResponsable.php 2007-04-30 20:29:21 UTC (rev 4597)
@@ -713,4 +713,39 @@
return $this->collRelRolresponsableResponsables;
}
+
+
+ public function getRelRolresponsableResponsablesJoinAlumno($criteria = null, $con = null)
+ {
+ include_once 'lib/model/om/BaseRelRolresponsableResponsablePeer.php';
+ if ($criteria === null) {
+ $criteria = new Criteria();
+ }
+ elseif ($criteria instanceof Criteria)
+ {
+ $criteria = clone $criteria;
+ }
+
+ if ($this->collRelRolresponsableResponsables === null) {
+ if ($this->isNew()) {
+ $this->collRelRolresponsableResponsables = array();
+ } else {
+
+ $criteria->add(RelRolresponsableResponsablePeer::FK_ROLRESPONSABLE_ID, $this->getId());
+
+ $this->collRelRolresponsableResponsables = RelRolresponsableResponsablePeer::doSelectJoinAlumno($criteria, $con);
+ }
+ } else {
+
+ $criteria->add(RelRolresponsableResponsablePeer::FK_ROLRESPONSABLE_ID, $this->getId());
+
+ if (!isset($this->lastRelRolresponsableResponsableCriteria) || !$this->lastRelRolresponsableResponsableCriteria->equals($criteria)) {
+ $this->collRelRolresponsableResponsables = RelRolresponsableResponsablePeer::doSelectJoinAlumno($criteria, $con);
+ }
+ }
+ $this->lastRelRolresponsableResponsableCriteria = $criteria;
+
+ return $this->collRelRolresponsableResponsables;
+ }
+
}
\ No newline at end of file
Más información sobre la lista de distribución Alba-desarrollo