Author: josx Date: 2008-01-23 16:12:27 -0200 (Wed, 23 Jan 2008) New Revision: 5429 Modified: prosistem/alba/trunk/alba/config/schema.yml prosistem/alba/trunk/alba/lib/model/om/BaseEstablecimiento.php Log: Se organizo con orden de precedencia el schema.yml Modified: prosistem/alba/trunk/alba/config/schema.yml =================================================================== --- prosistem/alba/trunk/alba/config/schema.yml 2008-01-23 15:57:04 UTC (rev 5428) +++ prosistem/alba/trunk/alba/config/schema.yml 2008-01-23 18:12:27 UTC (rev 5429) @@ -2,6 +2,126 @@ alba: _attributes: package: lib.model + conceptobaja: + _attributes: + idMethod: native + id: + type: integer + size: 11 + required: true + autoIncrement: true + primaryKey: true + nombre: + type: varchar + size: 128 + required: true + descripcion: + type: varchar + size: 255 + required: false + tipodocumento: + _attributes: + idMethod: native + id: + type: INTEGER + required: true + autoIncrement: true + primaryKey: true + nombre: + type: VARCHAR + size: 128 + required: true + descripcion: + type: VARCHAR + size: 255 + required: false + orden: + type: integer + size: 11 + required: false + default: 0 + tipoiva: + _attributes: + idMethod: native + id: + type: INTEGER + required: true + autoIncrement: true + primaryKey: true + nombre: + type: VARCHAR + size: 128 + required: true + descripcion: + type: VARCHAR + size: 255 + required: false + orden: + type: INTEGER + required: false + default: 0 + pais: + _attributes: + idMethod: native + id: + type: INTEGER + required: true + autoIncrement: true + primaryKey: true + nombre_largo: + type: VARCHAR + size: 128 + required: true + nombre_corto: + type: VARCHAR + size: 32 + required: true + orden: + type: INTEGER + required: false + default: 0 + provincia: + _attributes: + idMethod: native + id: + type: INTEGER + required: true + autoIncrement: true + primaryKey: true + nombre_corto: + type: VARCHAR + size: 32 + required: true + nombre_largo: + type: VARCHAR + size: 128 + required: true + fk_pais_id: + type: INTEGER + required: true + default: 0 + foreignTable: pais + foreignReference: id + orden: + type: INTEGER + required: false + default: 0 + tipolocacion: + _attributes: + idMethod: native + id: + type: INTEGER + required: true + autoIncrement: true + primaryKey: true + nombre: + type: VARCHAR + size: 128 + required: true + descripcion: + type: VARCHAR + size: 255 + required: false locacion: _attributes: idMethod: native @@ -129,22 +249,6 @@ type: VARCHAR size: 255 required: false - tipolocacion: - _attributes: - idMethod: native - id: - type: INTEGER - required: true - autoIncrement: true - primaryKey: true - nombre: - type: VARCHAR - size: 128 - required: true - descripcion: - type: VARCHAR - size: 255 - required: false distritoescolar: _attributes: idMethod: native @@ -166,39 +270,6 @@ ciudad: type: VARCHAR size: 128 - establecimiento: - _attributes: - idMethod: native - id: - type: INTEGER - required: true - autoIncrement: true - primaryKey: true - nombre: - type: VARCHAR - size: 128 - required: true - descripcion: - type: VARCHAR - size: 255 - fk_distritoescolar_id: - type: INTEGER - required: true - default: 0 - foreignTable: distritoescolar - foreignReference: id - fk_organizacion_id: - type: INTEGER - required: true - default: 0 - foreignTable: organizacion - foreignReference: id - fk_niveltipo_id: - type: INTEGER - required: true - default: 0 - foreignTable: niveltipo - foreignReference: id niveltipo: _attributes: idMethod: native @@ -265,7 +336,7 @@ default: 0 foreignTable: tipoiva foreignReference: id - pais: + establecimiento: _attributes: idMethod: native id: @@ -273,18 +344,31 @@ required: true autoIncrement: true primaryKey: true - nombre_largo: + nombre: type: VARCHAR size: 128 required: true - nombre_corto: + descripcion: type: VARCHAR - size: 32 + size: 255 + fk_distritoescolar_id: + type: INTEGER required: true - orden: + default: 0 + foreignTable: distritoescolar + foreignReference: id + fk_organizacion_id: type: INTEGER - required: false + required: true default: 0 + foreignTable: organizacion + foreignReference: id + fk_niveltipo_id: + type: INTEGER + required: true + default: 0 + foreignTable: niveltipo + foreignReference: id permiso: _attributes: idMethod: native @@ -328,83 +412,6 @@ type: BOOLEAN required: true default: true - rel_establecimiento_locacion: - _attributes: - idMethod: native - id: - type: INTEGER - required: true - autoIncrement: true - primaryKey: true - fk_establecimiento_id: - type: INTEGER - required: true - default: 0 - foreignTable: establecimiento - foreignReference: id - fk_locacion_id: - type: INTEGER - required: true - default: 0 - foreignTable: locacion - foreignReference: id - rel_rol_permiso: - _attributes: - idMethod: native - id: - type: INTEGER - required: true - autoIncrement: true - primaryKey: true - fk_rol_id: - type: INTEGER - required: true - default: 0 - foreignTable: rol - foreignReference: id - fk_permiso_id: - type: INTEGER - required: true - default: 0 - foreignTable: permiso - foreignReference: id - rel_usuario_permiso: - _attributes: - idMethod: native - id: - type: INTEGER - required: true - autoIncrement: true - primaryKey: true - fk_usuario_id: - type: INTEGER - required: true - default: 0 - foreignTable: usuario - foreignReference: id - fk_permiso_id: - type: INTEGER - required: true - default: 0 - foreignTable: permiso - foreignReference: id - onDelete: CASCADE - rel_usuario_preferencia: - _attributes: - idMethod: native - id: - type: INTEGER - required: true - autoIncrement: true - primaryKey: true - fk_usuario_id: - type: INTEGER - required: true - default: 0 - fk_preferencia_id: - type: INTEGER - required: true - default: 0 rol: _attributes: idMethod: native @@ -473,7 +480,7 @@ type: BOOLEAN required: true default: false - orientacion: + rel_establecimiento_locacion: _attributes: idMethod: native id: @@ -481,15 +488,19 @@ required: true autoIncrement: true primaryKey: true - nombre: - type: VARCHAR - size: 128 + fk_establecimiento_id: + type: INTEGER required: true - descripcion: - type: VARCHAR - size: 255 - required: false - tipoiva: + default: 0 + foreignTable: establecimiento + foreignReference: id + fk_locacion_id: + type: INTEGER + required: true + default: 0 + foreignTable: locacion + foreignReference: id + rel_rol_permiso: _attributes: idMethod: native id: @@ -497,19 +508,19 @@ required: true autoIncrement: true primaryKey: true - nombre: - type: VARCHAR - size: 128 + fk_rol_id: + type: INTEGER required: true - descripcion: - type: VARCHAR - size: 255 - required: false - orden: + default: 0 + foreignTable: rol + foreignReference: id + fk_permiso_id: type: INTEGER - required: false + required: true default: 0 - provincia: + foreignTable: permiso + foreignReference: id + rel_usuario_permiso: _attributes: idMethod: native id: @@ -517,24 +528,51 @@ required: true autoIncrement: true primaryKey: true - nombre_corto: - type: VARCHAR - size: 32 + fk_usuario_id: + type: INTEGER required: true - nombre_largo: - type: VARCHAR - size: 128 - required: true - fk_pais_id: + default: 0 + foreignTable: usuario + foreignReference: id + fk_permiso_id: type: INTEGER required: true default: 0 - foreignTable: pais + foreignTable: permiso foreignReference: id - orden: + onDelete: CASCADE + rel_usuario_preferencia: + _attributes: + idMethod: native + id: type: INTEGER + required: true + autoIncrement: true + primaryKey: true + fk_usuario_id: + type: INTEGER + required: true + default: 0 + fk_preferencia_id: + type: INTEGER + required: true + default: 0 + orientacion: + _attributes: + idMethod: native + id: + type: INTEGER + required: true + autoIncrement: true + primaryKey: true + nombre: + type: VARCHAR + size: 128 + required: true + descripcion: + type: VARCHAR + size: 255 required: false - default: 0 cuenta: _attributes: idMethod: native @@ -689,6 +727,25 @@ default: 0 foreignTable: pais foreignReference: id + rol_responsable: + _attributes: + idMethod: native + id: + type: INTEGER + required: true + autoIncrement: true + primaryKey: true + nombre: + type: VARCHAR + size: 128 + required: true + descripcion: + type: VARCHAR + size: 255 + activo: + type: BOOLEAN + required: true + default: true responsable: _attributes: idMethod: native @@ -848,23 +905,6 @@ type: varchar size: 255 required: true - conceptobaja: - _attributes: - idMethod: native - id: - type: integer - size: 11 - required: true - autoIncrement: true - primaryKey: true - nombre: - type: varchar - size: 128 - required: true - descripcion: - type: varchar - size: 255 - required: false tipodocente: _attributes: idMethod: native @@ -956,6 +996,19 @@ fecha: type: TIMESTAMP required: false + legajocategoria: + _attributes: + idMethod: native + id: + type: integer + size: 11 + required: true + autoIncrement: true + primaryKey: true + descripcion: + type: varchar + size: 255 + required: true legajopedagogico: _attributes: idMethod: native @@ -996,7 +1049,7 @@ required: true foreignTable: legajocategoria foreignReference: id - legajocategoria: + adjunto: _attributes: idMethod: native id: @@ -1008,7 +1061,26 @@ descripcion: type: varchar size: 255 + required: false + titulo: + type: varchar + size: 255 + required: false + nombre_archivo: + type: varchar + size: 255 required: true + tipo_archivo: + type: varchar + size: 64 + required: true + ruta: + type: varchar + size: 255 + required: true + fecha: + type: timestamp + required: true legajoadjunto: _attributes: idMethod: native @@ -1024,38 +1096,37 @@ required: true foreignTable: adjunto foreignReference: id - adjunto: + tipoasistencia: _attributes: idMethod: native id: - type: integer + type: INTEGER size: 11 required: true autoIncrement: true primaryKey: true + nombre: + type: VARCHAR + size: 10 + required: true descripcion: - type: varchar + type: VARCHAR size: 255 required: false - titulo: - type: varchar - size: 255 + valor: + type: DECIMAL + size: 4 + scale: 2 + required: true + default: 1 + grupo: + type: VARCHAR + size: 30 required: false - nombre_archivo: - type: varchar - size: 255 + defecto: + type: BOOLEAN required: true - tipo_archivo: - type: varchar - size: 64 - required: true - ruta: - type: varchar - size: 255 - required: true - fecha: - type: timestamp - required: true + default: 0 asistencia: _attributes: idMethod: native @@ -1178,6 +1249,30 @@ fecha: type: timestamp required: true + actividad: + _attributes: + idMethod: native + id: + type: integer + size: 11 + required: true + autoIncrement: true + primaryKey: true + fk_establecimiento_id: + type: integer + size: 11 + required: true + default: 0 + foreignTable: establecimiento + foreignReference: id + nombre: + type: varchar + size: 128 + required: true + descripcion: + type: varchar + size: 255 + required: false boletin_actividades: _attributes: idMethod: native @@ -1346,30 +1441,6 @@ size: 11 required: true default: 0 - actividad: - _attributes: - idMethod: native - id: - type: integer - size: 11 - required: true - autoIncrement: true - primaryKey: true - fk_establecimiento_id: - type: integer - size: 11 - required: true - default: 0 - foreignTable: establecimiento - foreignReference: id - nombre: - type: varchar - size: 128 - required: true - descripcion: - type: varchar - size: 255 - required: false rel_anio_actividad: _attributes: idMethod: native @@ -1428,44 +1499,6 @@ default: 0 foreignTable: alumno foreignReference: id - rel_division_actividad_docente: - _attributes: - idMethod: native - id: - type: integer - size: 11 - required: true - autoIncrement: true - primaryKey: true - fk_division_id: - type: integer - size: 11 - required: false - default: 0 - foreignTable: division - foreignReference: id - fk_actividad_id: - type: integer - size: 11 - required: true - default: 0 - foreignTable: actividad - foreignReference: id - fk_docente_id: - type: integer - size: 11 - required: false - default: 0 - foreignTable: docente - foreignReference: id - fk_evento_id: - type: integer - size: 11 - required: false - default: 0 - foreignTable: evento - foreignReference: id - onDelete: cascade docente: _attributes: idMethod: native @@ -1558,24 +1591,23 @@ default: 0 foreignTable: pais foreignReference: id - rel_docente_establecimiento: + horarioescolartipo: _attributes: idMethod: native - fk_establecimiento_id: - type: integer - size: 11 + id: + type: INTEGER required: true - default: 0 - foreignTable: establecimiento - foreignReference: id - fk_docente_id: - type: integer - size: 11 + autoIncrement: true + primaryKey: true + nombre: + type: VARCHAR + size: 128 required: true - default: 0 - foreignTable: docente - foreignReference: id - tipodocumento: + descripcion: + type: VARCHAR + size: 255 + required: false + evento: _attributes: idMethod: native id: @@ -1583,19 +1615,95 @@ required: true autoIncrement: true primaryKey: true - nombre: + titulo: type: VARCHAR size: 128 required: true - descripcion: + fecha_inicio: + type: TIMESTAMP + required: true + fecha_fin: + type: TIMESTAMP + required: true + tipo: + type: INTEGER + required: true + default: 0 + frecuencia: + type: INTEGER + required: true + default: 0 + frecuencia_intervalo: + type: INTEGER + required: true + default: 0 + recurrencia_fin: type: VARCHAR - size: 255 + size: 16 required: false - orden: + recurrencia_dias: + type: INTEGER + required: true + default: 0 + estado: + type: INTEGER + required: true + default: 0 + rel_division_actividad_docente: + _attributes: + idMethod: native + id: type: integer size: 11 + required: true + autoIncrement: true + primaryKey: true + fk_division_id: + type: integer + size: 11 required: false default: 0 + foreignTable: division + foreignReference: id + fk_actividad_id: + type: integer + size: 11 + required: true + default: 0 + foreignTable: actividad + foreignReference: id + fk_docente_id: + type: integer + size: 11 + required: false + default: 0 + foreignTable: docente + foreignReference: id + fk_evento_id: + type: integer + size: 11 + required: false + default: 0 + foreignTable: evento + foreignReference: id + onDelete: cascade + rel_docente_establecimiento: + _attributes: + idMethod: native + fk_establecimiento_id: + type: integer + size: 11 + required: true + default: 0 + foreignTable: establecimiento + foreignReference: id + fk_docente_id: + type: integer + size: 11 + required: true + default: 0 + foreignTable: docente + foreignReference: id docente_horario: _attributes: idMethod: native @@ -1686,114 +1794,6 @@ default: 0 foreignTable: horarioescolartipo foreignReference: id - horarioescolartipo: - _attributes: - idMethod: native - id: - type: INTEGER - required: true - autoIncrement: true - primaryKey: true - nombre: - type: VARCHAR - size: 128 - required: true - descripcion: - type: VARCHAR - size: 255 - required: false - tipoasistencia: - _attributes: - idMethod: native - id: - type: INTEGER - size: 11 - required: true - autoIncrement: true - primaryKey: true - nombre: - type: VARCHAR - size: 10 - required: true - descripcion: - type: VARCHAR - size: 255 - required: false - valor: - type: DECIMAL - size: 4 - scale: 2 - required: true - default: 1 - grupo: - type: VARCHAR - size: 30 - required: false - defecto: - type: BOOLEAN - required: true - default: 0 - rol_responsable: - _attributes: - idMethod: native - id: - type: INTEGER - required: true - autoIncrement: true - primaryKey: true - nombre: - type: VARCHAR - size: 128 - required: true - descripcion: - type: VARCHAR - size: 255 - activo: - type: BOOLEAN - required: true - default: true - evento: - _attributes: - idMethod: native - id: - type: INTEGER - required: true - autoIncrement: true - primaryKey: true - titulo: - type: VARCHAR - size: 128 - required: true - fecha_inicio: - type: TIMESTAMP - required: true - fecha_fin: - type: TIMESTAMP - required: true - tipo: - type: INTEGER - required: true - default: 0 - frecuencia: - type: INTEGER - required: true - default: 0 - frecuencia_intervalo: - type: INTEGER - required: true - default: 0 - recurrencia_fin: - type: VARCHAR - size: 16 - required: false - recurrencia_dias: - type: INTEGER - required: true - default: 0 - estado: - type: INTEGER - required: true - default: 0 rel_rolresponsable_responsable: _attributes: idMethod: native @@ -1844,6 +1844,22 @@ primaryKey: true foreignTable: docente foreignReference: id + tipoinforme: + _attributes: + idMethod: native + id: + type: INTEGER + required: true + autoIncrement: true + primaryKey: true + nombre: + type: VARCHAR + size: 128 + required: true + descripcion: + type: VARCHAR + size: 255 + required: false informe: _attributes: idMethod: native @@ -1877,20 +1893,4 @@ default: false variables: type: VARCHAR - size: 128 - tipoinforme: - _attributes: - idMethod: native - id: - type: INTEGER - required: true - autoIncrement: true - primaryKey: true - nombre: - type: VARCHAR - size: 128 - required: true - descripcion: - type: VARCHAR - size: 255 - required: false + size: 128 \ No newline at end of file Modified: prosistem/alba/trunk/alba/lib/model/om/BaseEstablecimiento.php =================================================================== --- prosistem/alba/trunk/alba/lib/model/om/BaseEstablecimiento.php 2008-01-23 15:57:04 UTC (rev 5428) +++ prosistem/alba/trunk/alba/lib/model/om/BaseEstablecimiento.php 2008-01-23 18:12:27 UTC (rev 5429) @@ -41,16 +41,16 @@ protected $aNiveltipo; - protected $collRelEstablecimientoLocacions; + protected $collUsuarios; - protected $lastRelEstablecimientoLocacionCriteria = null; + protected $lastUsuarioCriteria = null; - protected $collUsuarios; + protected $collRelEstablecimientoLocacions; - protected $lastUsuarioCriteria = null; + protected $lastRelEstablecimientoLocacionCriteria = null; protected $collAlumnos; @@ -77,16 +77,16 @@ protected $lastEscalanotaCriteria = null; - protected $collAnios; + protected $collActividads; - protected $lastAnioCriteria = null; + protected $lastActividadCriteria = null; - protected $collActividads; + protected $collAnios; - protected $lastActividadCriteria = null; + protected $lastAnioCriteria = null; protected $collRelDocenteEstablecimientos; @@ -356,16 +356,16 @@ } $this->resetModified(); } - if ($this->collRelEstablecimientoLocacions !== null) { - foreach($this->collRelEstablecimientoLocacions as $referrerFK) { + if ($this->collUsuarios !== null) { + foreach($this->collUsuarios as $referrerFK) { if (!$referrerFK->isDeleted()) { $affectedRows += $referrerFK->save($con); } } } - if ($this->collUsuarios !== null) { - foreach($this->collUsuarios as $referrerFK) { + if ($this->collRelEstablecimientoLocacions !== null) { + foreach($this->collRelEstablecimientoLocacions as $referrerFK) { if (!$referrerFK->isDeleted()) { $affectedRows += $referrerFK->save($con); } @@ -404,16 +404,16 @@ } } - if ($this->collAnios !== null) { - foreach($this->collAnios as $referrerFK) { + if ($this->collActividads !== null) { + foreach($this->collActividads as $referrerFK) { if (!$referrerFK->isDeleted()) { $affectedRows += $referrerFK->save($con); } } } - if ($this->collActividads !== null) { - foreach($this->collActividads as $referrerFK) { + if ($this->collAnios !== null) { + foreach($this->collAnios as $referrerFK) { if (!$referrerFK->isDeleted()) { $affectedRows += $referrerFK->save($con); } @@ -497,16 +497,16 @@ } - if ($this->collRelEstablecimientoLocacions !== null) { - foreach($this->collRelEstablecimientoLocacions as $referrerFK) { + if ($this->collUsuarios !== null) { + foreach($this->collUsuarios as $referrerFK) { if (!$referrerFK->validate($columns)) { $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures()); } } } - if ($this->collUsuarios !== null) { - foreach($this->collUsuarios as $referrerFK) { + if ($this->collRelEstablecimientoLocacions !== null) { + foreach($this->collRelEstablecimientoLocacions as $referrerFK) { if (!$referrerFK->validate($columns)) { $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures()); } @@ -545,16 +545,16 @@ } } - if ($this->collAnios !== null) { - foreach($this->collAnios as $referrerFK) { + if ($this->collActividads !== null) { + foreach($this->collActividads as $referrerFK) { if (!$referrerFK->validate($columns)) { $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures()); } } } - if ($this->collActividads !== null) { - foreach($this->collActividads as $referrerFK) { + if ($this->collAnios !== null) { + foreach($this->collAnios as $referrerFK) { if (!$referrerFK->validate($columns)) { $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures()); } @@ -732,14 +732,14 @@ if ($deepCopy) { $copyObj->setNew(false); + foreach($this->getUsuarios() as $relObj) { + $copyObj->addUsuario($relObj->copy($deepCopy)); + } + foreach($this->getRelEstablecimientoLocacions() as $relObj) { $copyObj->addRelEstablecimientoLocacion($relObj->copy($deepCopy)); } - foreach($this->getUsuarios() as $relObj) { - $copyObj->addUsuario($relObj->copy($deepCopy)); - } - foreach($this->getAlumnos() as $relObj) { $copyObj->addAlumno($relObj->copy($deepCopy)); } @@ -756,14 +756,14 @@ $copyObj->addEscalanota($relObj->copy($deepCopy)); } + foreach($this->getActividads() as $relObj) { + $copyObj->addActividad($relObj->copy($deepCopy)); + } + foreach($this->getAnios() as $relObj) { $copyObj->addAnio($relObj->copy($deepCopy)); } - foreach($this->getActividads() as $relObj) { - $copyObj->addActividad($relObj->copy($deepCopy)); - } - foreach($this->getRelDocenteEstablecimientos() as $relObj) { $copyObj->addRelDocenteEstablecimiento($relObj->copy($deepCopy)); } @@ -888,6 +888,76 @@ } + public function initUsuarios() + { + if ($this->collUsuarios === null) { + $this->collUsuarios = array(); + } + } + + + public function getUsuarios($criteria = null, $con = null) + { + include_once 'lib/model/om/BaseUsuarioPeer.php'; + if ($criteria === null) { + $criteria = new Criteria(); + } + elseif ($criteria instanceof Criteria) + { + $criteria = clone $criteria; + } + + if ($this->collUsuarios === null) { + if ($this->isNew()) { + $this->collUsuarios = array(); + } else { + + $criteria->add(UsuarioPeer::FK_ESTABLECIMIENTO_ID, $this->getId()); + + UsuarioPeer::addSelectColumns($criteria); + $this->collUsuarios = UsuarioPeer::doSelect($criteria, $con); + } + } else { + if (!$this->isNew()) { + + + $criteria->add(UsuarioPeer::FK_ESTABLECIMIENTO_ID, $this->getId()); + + UsuarioPeer::addSelectColumns($criteria); + if (!isset($this->lastUsuarioCriteria) || !$this->lastUsuarioCriteria->equals($criteria)) { + $this->collUsuarios = UsuarioPeer::doSelect($criteria, $con); + } + } + } + $this->lastUsuarioCriteria = $criteria; + return $this->collUsuarios; + } + + + public function countUsuarios($criteria = null, $distinct = false, $con = null) + { + include_once 'lib/model/om/BaseUsuarioPeer.php'; + if ($criteria === null) { + $criteria = new Criteria(); + } + elseif ($criteria instanceof Criteria) + { + $criteria = clone $criteria; + } + + $criteria->add(UsuarioPeer::FK_ESTABLECIMIENTO_ID, $this->getId()); + + return UsuarioPeer::doCount($criteria, $distinct, $con); + } + + + public function addUsuario(Usuario $l) + { + $this->collUsuarios[] = $l; + $l->setEstablecimiento($this); + } + + public function initRelEstablecimientoLocacions() { if ($this->collRelEstablecimientoLocacions === null) { @@ -993,76 +1063,6 @@ } - public function initUsuarios() - { - if ($this->collUsuarios === null) { - $this->collUsuarios = array(); - } - } - - - public function getUsuarios($criteria = null, $con = null) - { - include_once 'lib/model/om/BaseUsuarioPeer.php'; - if ($criteria === null) { - $criteria = new Criteria(); - } - elseif ($criteria instanceof Criteria) - { - $criteria = clone $criteria; - } - - if ($this->collUsuarios === null) { - if ($this->isNew()) { - $this->collUsuarios = array(); - } else { - - $criteria->add(UsuarioPeer::FK_ESTABLECIMIENTO_ID, $this->getId()); - - UsuarioPeer::addSelectColumns($criteria); - $this->collUsuarios = UsuarioPeer::doSelect($criteria, $con); - } - } else { - if (!$this->isNew()) { - - - $criteria->add(UsuarioPeer::FK_ESTABLECIMIENTO_ID, $this->getId()); - - UsuarioPeer::addSelectColumns($criteria); - if (!isset($this->lastUsuarioCriteria) || !$this->lastUsuarioCriteria->equals($criteria)) { - $this->collUsuarios = UsuarioPeer::doSelect($criteria, $con); - } - } - } - $this->lastUsuarioCriteria = $criteria; - return $this->collUsuarios; - } - - - public function countUsuarios($criteria = null, $distinct = false, $con = null) - { - include_once 'lib/model/om/BaseUsuarioPeer.php'; - if ($criteria === null) { - $criteria = new Criteria(); - } - elseif ($criteria instanceof Criteria) - { - $criteria = clone $criteria; - } - - $criteria->add(UsuarioPeer::FK_ESTABLECIMIENTO_ID, $this->getId()); - - return UsuarioPeer::doCount($criteria, $distinct, $con); - } - - - public function addUsuario(Usuario $l) - { - $this->collUsuarios[] = $l; - $l->setEstablecimiento($this); - } - - public function initAlumnos() { if ($this->collAlumnos === null) { @@ -1518,17 +1518,17 @@ } - public function initAnios() + public function initActividads() { - if ($this->collAnios === null) { - $this->collAnios = array(); + if ($this->collActividads === null) { + $this->collActividads = array(); } } - public function getAnios($criteria = null, $con = null) + public function getActividads($criteria = null, $con = null) { - include_once 'lib/model/om/BaseAnioPeer.php'; + include_once 'lib/model/om/BaseActividadPeer.php'; if ($criteria === null) { $criteria = new Criteria(); } @@ -1537,36 +1537,36 @@ $criteria = clone $criteria; } - if ($this->collAnios === null) { + if ($this->collActividads === null) { if ($this->isNew()) { - $this->collAnios = array(); + $this->collActividads = array(); } else { - $criteria->add(AnioPeer::FK_ESTABLECIMIENTO_ID, $this->getId()); + $criteria->add(ActividadPeer::FK_ESTABLECIMIENTO_ID, $this->getId()); - AnioPeer::addSelectColumns($criteria); - $this->collAnios = AnioPeer::doSelect($criteria, $con); + ActividadPeer::addSelectColumns($criteria); + $this->collActividads = ActividadPeer::doSelect($criteria, $con); } } else { if (!$this->isNew()) { - $criteria->add(AnioPeer::FK_ESTABLECIMIENTO_ID, $this->getId()); + $criteria->add(ActividadPeer::FK_ESTABLECIMIENTO_ID, $this->getId()); - AnioPeer::addSelectColumns($criteria); - if (!isset($this->lastAnioCriteria) || !$this->lastAnioCriteria->equals($criteria)) { - $this->collAnios = AnioPeer::doSelect($criteria, $con); + ActividadPeer::addSelectColumns($criteria); + if (!isset($this->lastActividadCriteria) || !$this->lastActividadCriteria->equals($criteria)) { + $this->collActividads = ActividadPeer::doSelect($criteria, $con); } } } - $this->lastAnioCriteria = $criteria; - return $this->collAnios; + $this->lastActividadCriteria = $criteria; + return $this->collActividads; } - public function countAnios($criteria = null, $distinct = false, $con = null) + public function countActividads($criteria = null, $distinct = false, $con = null) { - include_once 'lib/model/om/BaseAnioPeer.php'; + include_once 'lib/model/om/BaseActividadPeer.php'; if ($criteria === null) { $criteria = new Criteria(); } @@ -1575,30 +1575,30 @@ $criteria = clone $criteria; } - $criteria->add(AnioPeer::FK_ESTABLECIMIENTO_ID, $this->getId()); + $criteria->add(ActividadPeer::FK_ESTABLECIMIENTO_ID, $this->getId()); - return AnioPeer::doCount($criteria, $distinct, $con); + return ActividadPeer::doCount($criteria, $distinct, $con); } - public function addAnio(Anio $l) + public function addActividad(Actividad $l) { - $this->collAnios[] = $l; + $this->collActividads[] = $l; $l->setEstablecimiento($this); } - public function initActividads() + public function initAnios() { - if ($this->collActividads === null) { - $this->collActividads = array(); + if ($this->collAnios === null) { + $this->collAnios = array(); } } - public function getActividads($criteria = null, $con = null) + public function getAnios($criteria = null, $con = null) { - include_once 'lib/model/om/BaseActividadPeer.php'; + include_once 'lib/model/om/BaseAnioPeer.php'; if ($criteria === null) { $criteria = new Criteria(); } @@ -1607,36 +1607,36 @@ $criteria = clone $criteria; } - if ($this->collActividads === null) { + if ($this->collAnios === null) { if ($this->isNew()) { - $this->collActividads = array(); + $this->collAnios = array(); } else { - $criteria->add(ActividadPeer::FK_ESTABLECIMIENTO_ID, $this->getId()); + $criteria->add(AnioPeer::FK_ESTABLECIMIENTO_ID, $this->getId()); - ActividadPeer::addSelectColumns($criteria); - $this->collActividads = ActividadPeer::doSelect($criteria, $con); + AnioPeer::addSelectColumns($criteria); + $this->collAnios = AnioPeer::doSelect($criteria, $con); } } else { if (!$this->isNew()) { - $criteria->add(ActividadPeer::FK_ESTABLECIMIENTO_ID, $this->getId()); + $criteria->add(AnioPeer::FK_ESTABLECIMIENTO_ID, $this->getId()); - ActividadPeer::addSelectColumns($criteria); - if (!isset($this->lastActividadCriteria) || !$this->lastActividadCriteria->equals($criteria)) { - $this->collActividads = ActividadPeer::doSelect($criteria, $con); + AnioPeer::addSelectColumns($criteria); + if (!isset($this->lastAnioCriteria) || !$this->lastAnioCriteria->equals($criteria)) { + $this->collAnios = AnioPeer::doSelect($criteria, $con); } } } - $this->lastActividadCriteria = $criteria; - return $this->collActividads; + $this->lastAnioCriteria = $criteria; + return $this->collAnios; } - public function countActividads($criteria = null, $distinct = false, $con = null) + public function countAnios($criteria = null, $distinct = false, $con = null) { - include_once 'lib/model/om/BaseActividadPeer.php'; + include_once 'lib/model/om/BaseAnioPeer.php'; if ($criteria === null) { $criteria = new Criteria(); } @@ -1645,15 +1645,15 @@ $criteria = clone $criteria; } - $criteria->add(ActividadPeer::FK_ESTABLECIMIENTO_ID, $this->getId()); + $criteria->add(AnioPeer::FK_ESTABLECIMIENTO_ID, $this->getId()); - return ActividadPeer::doCount($criteria, $distinct, $con); + return AnioPeer::doCount($criteria, $distinct, $con); } - public function addActividad(Actividad $l) + public function addAnio(Anio $l) { - $this->collActividads[] = $l; + $this->collAnios[] = $l; $l->setEstablecimiento($this); }