Esempio n. 1
0
 public function save(PropelPDO $con = null)
 {
     if ($this->isDeleted()) {
         throw new PropelException("You cannot save an object that has been deleted.");
     }
     if ($con === null) {
         $con = Propel::getConnection(ResponsablePeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
     }
     $con->beginTransaction();
     try {
         $affectedRows = $this->doSave($con);
         $con->commit();
         ResponsablePeer::addInstanceToPool($this);
         return $affectedRows;
     } catch (PropelException $e) {
         $con->rollBack();
         throw $e;
     }
 }
Esempio n. 2
0
 public static function doSelectJoinAllExceptNivelInstruccion(Criteria $c, $con = null, $join_behavior = Criteria::LEFT_JOIN)
 {
     $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;
     ProvinciaPeer::addSelectColumns($c);
     $startcol3 = $startcol2 + (ProvinciaPeer::NUM_COLUMNS - ProvinciaPeer::NUM_LAZY_LOAD_COLUMNS);
     TipodocumentoPeer::addSelectColumns($c);
     $startcol4 = $startcol3 + (TipodocumentoPeer::NUM_COLUMNS - TipodocumentoPeer::NUM_LAZY_LOAD_COLUMNS);
     CuentaPeer::addSelectColumns($c);
     $startcol5 = $startcol4 + (CuentaPeer::NUM_COLUMNS - CuentaPeer::NUM_LAZY_LOAD_COLUMNS);
     RolResponsablePeer::addSelectColumns($c);
     $startcol6 = $startcol5 + (RolResponsablePeer::NUM_COLUMNS - RolResponsablePeer::NUM_LAZY_LOAD_COLUMNS);
     $c->addJoin(array(ResponsablePeer::FK_PROVINCIA_ID), array(ProvinciaPeer::ID), $join_behavior);
     $c->addJoin(array(ResponsablePeer::FK_TIPODOCUMENTO_ID), array(TipodocumentoPeer::ID), $join_behavior);
     $c->addJoin(array(ResponsablePeer::FK_CUENTA_ID), array(CuentaPeer::ID), $join_behavior);
     $c->addJoin(array(ResponsablePeer::FK_ROLRESPONSABLE_ID), array(RolResponsablePeer::ID), $join_behavior);
     $stmt = BasePeer::doSelect($c, $con);
     $results = array();
     while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
         $key1 = ResponsablePeer::getPrimaryKeyHashFromRow($row, 0);
         if (null !== ($obj1 = ResponsablePeer::getInstanceFromPool($key1))) {
         } else {
             $omClass = ResponsablePeer::getOMClass();
             $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
             $obj1 = new $cls();
             $obj1->hydrate($row);
             ResponsablePeer::addInstanceToPool($obj1, $key1);
         }
         $key2 = ProvinciaPeer::getPrimaryKeyHashFromRow($row, $startcol2);
         if ($key2 !== null) {
             $obj2 = ProvinciaPeer::getInstanceFromPool($key2);
             if (!$obj2) {
                 $omClass = ProvinciaPeer::getOMClass();
                 $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
                 $obj2 = new $cls();
                 $obj2->hydrate($row, $startcol2);
                 ProvinciaPeer::addInstanceToPool($obj2, $key2);
             }
             $obj2->addResponsable($obj1);
         }
         $key3 = TipodocumentoPeer::getPrimaryKeyHashFromRow($row, $startcol3);
         if ($key3 !== null) {
             $obj3 = TipodocumentoPeer::getInstanceFromPool($key3);
             if (!$obj3) {
                 $omClass = TipodocumentoPeer::getOMClass();
                 $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
                 $obj3 = new $cls();
                 $obj3->hydrate($row, $startcol3);
                 TipodocumentoPeer::addInstanceToPool($obj3, $key3);
             }
             $obj3->addResponsable($obj1);
         }
         $key4 = CuentaPeer::getPrimaryKeyHashFromRow($row, $startcol4);
         if ($key4 !== null) {
             $obj4 = CuentaPeer::getInstanceFromPool($key4);
             if (!$obj4) {
                 $omClass = CuentaPeer::getOMClass();
                 $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
                 $obj4 = new $cls();
                 $obj4->hydrate($row, $startcol4);
                 CuentaPeer::addInstanceToPool($obj4, $key4);
             }
             $obj4->addResponsable($obj1);
         }
         $key5 = RolResponsablePeer::getPrimaryKeyHashFromRow($row, $startcol5);
         if ($key5 !== null) {
             $obj5 = RolResponsablePeer::getInstanceFromPool($key5);
             if (!$obj5) {
                 $omClass = RolResponsablePeer::getOMClass();
                 $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
                 $obj5 = new $cls();
                 $obj5->hydrate($row, $startcol5);
                 RolResponsablePeer::addInstanceToPool($obj5, $key5);
             }
             $obj5->addResponsable($obj1);
         }
         $results[] = $obj1;
     }
     $stmt->closeCursor();
     return $results;
 }
 public static function doSelectJoinAllExceptAlumno(Criteria $c, $con = null, $join_behavior = Criteria::LEFT_JOIN)
 {
     $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;
     RolResponsablePeer::addSelectColumns($c);
     $startcol3 = $startcol2 + (RolResponsablePeer::NUM_COLUMNS - RolResponsablePeer::NUM_LAZY_LOAD_COLUMNS);
     ResponsablePeer::addSelectColumns($c);
     $startcol4 = $startcol3 + (ResponsablePeer::NUM_COLUMNS - ResponsablePeer::NUM_LAZY_LOAD_COLUMNS);
     $c->addJoin(array(RelRolresponsableResponsablePeer::FK_ROLRESPONSABLE_ID), array(RolResponsablePeer::ID), $join_behavior);
     $c->addJoin(array(RelRolresponsableResponsablePeer::FK_RESPONSABLE_ID), array(ResponsablePeer::ID), $join_behavior);
     $stmt = BasePeer::doSelect($c, $con);
     $results = array();
     while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
         $key1 = RelRolresponsableResponsablePeer::getPrimaryKeyHashFromRow($row, 0);
         if (null !== ($obj1 = RelRolresponsableResponsablePeer::getInstanceFromPool($key1))) {
         } else {
             $omClass = RelRolresponsableResponsablePeer::getOMClass();
             $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
             $obj1 = new $cls();
             $obj1->hydrate($row);
             RelRolresponsableResponsablePeer::addInstanceToPool($obj1, $key1);
         }
         $key2 = RolResponsablePeer::getPrimaryKeyHashFromRow($row, $startcol2);
         if ($key2 !== null) {
             $obj2 = RolResponsablePeer::getInstanceFromPool($key2);
             if (!$obj2) {
                 $omClass = RolResponsablePeer::getOMClass();
                 $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
                 $obj2 = new $cls();
                 $obj2->hydrate($row, $startcol2);
                 RolResponsablePeer::addInstanceToPool($obj2, $key2);
             }
             $obj2->addRelRolresponsableResponsable($obj1);
         }
         $key3 = ResponsablePeer::getPrimaryKeyHashFromRow($row, $startcol3);
         if ($key3 !== null) {
             $obj3 = ResponsablePeer::getInstanceFromPool($key3);
             if (!$obj3) {
                 $omClass = ResponsablePeer::getOMClass();
                 $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
                 $obj3 = new $cls();
                 $obj3->hydrate($row, $startcol3);
                 ResponsablePeer::addInstanceToPool($obj3, $key3);
             }
             $obj3->addRelRolresponsableResponsable($obj1);
         }
         $results[] = $obj1;
     }
     $stmt->closeCursor();
     return $results;
 }