function getPuserKusers($lastPuserKuser, $userLimitEachLoop)
{
    PuserKuserPeer::clearInstancePool();
    $c = new Criteria();
    $c->add(PuserKuserPeer::ID, $lastPuserKuser, Criteria::GREATER_THAN);
    $c->addAscendingOrderByColumn(PuserKuserPeer::ID);
    $c->setLimit($userLimitEachLoop);
    PuserKuserPeer::setUseCriteriaFilter(false);
    $puserKusers = PuserKuserPeer::doSelect($c);
    PuserKuserPeer::setUseCriteriaFilter(true);
    return $puserKusers;
}
Exemplo n.º 2
0
 /**
  * Reloads this object from datastore based on primary key and (optionally) resets all associated objects.
  *
  * This will only work if the object has been saved and has a valid primary key set.
  *
  * @param      boolean $deep (optional) Whether to also de-associated any related objects.
  * @param      PropelPDO $con (optional) The PropelPDO connection to use.
  * @return     void
  * @throws     PropelException - if this object is deleted, unsaved or doesn't have pk match in db
  */
 public function reload($deep = false, PropelPDO $con = null)
 {
     if ($this->isDeleted()) {
         throw new PropelException("Cannot reload a deleted object.");
     }
     if ($this->isNew()) {
         throw new PropelException("Cannot reload an unsaved object.");
     }
     if ($con === null) {
         $con = Propel::getConnection(PuserKuserPeer::DATABASE_NAME, Propel::CONNECTION_READ);
     }
     // We don't need to alter the object instance pool; we're just modifying this instance
     // already in the pool.
     PuserKuserPeer::setUseCriteriaFilter(false);
     $stmt = PuserKuserPeer::doSelectStmt($this->buildPkeyCriteria(), $con);
     PuserKuserPeer::setUseCriteriaFilter(true);
     $row = $stmt->fetch(PDO::FETCH_NUM);
     $stmt->closeCursor();
     if (!$row) {
         throw new PropelException('Cannot find matching row in the database to reload object values.');
     }
     $this->hydrate($row, 0, true);
     // rehydrate
     if ($deep) {
         // also de-associate any related objects?
         $this->akuser = null;
         $this->collPuserRolesRelatedByPartnerId = null;
         $this->lastPuserRoleRelatedByPartnerIdCriteria = null;
         $this->collPuserRolesRelatedByPuserId = null;
         $this->lastPuserRoleRelatedByPuserIdCriteria = null;
     }
     // if (deep)
 }
Exemplo n.º 3
0
 /**
  * 
  * Gets all the pusers from the puser table
  * @param int $lastPuserId - the last puser id 
  * @param int $limit - the limit for the query
  */
 private function getAllPusersInPuser($lastPuserId, $limit)
 {
     $pusers = array();
     PuserKuserPeer::clearInstancePool();
     $c = new Criteria();
     $c->add(PuserKuserPeer::ID, $lastPuserId, Criteria::GREATER_THAN);
     // if case we have several entries in the same date (and we stop in the middle)
     $c->addAnd(PuserKuserPeer::PUSER_ID, null, Criteria::NOT_EQUAL);
     $c->addAnd(PuserKuserPeer::PUSER_ID, "", Criteria::NOT_EQUAL);
     if ($this->partnerId) {
         $c->addAnd(PuserKuserPeer::PARTNER_ID, $this->partnerId, Criteria::EQUAL);
     }
     $c->addAnd(PuserKuserPeer::PARTNER_ID, $this->ignorePartners, Criteria::NOT_IN);
     $c->addAscendingOrderByColumn(PuserKuserPeer::ID);
     $c->setLimit($limit);
     PuserKuserPeer::setUseCriteriaFilter(false);
     $pusers1 = PuserKuserPeer::doSelect($c);
     PuserKuserPeer::setUseCriteriaFilter(true);
     foreach ($pusers1 as $puser) {
         //	$this->printToLog("Found puser with id [{$puser->getId()}], partner [{$puser->getPartnerId()}]");
         $pusers[] = new puserDetails($puser->getPuserId(), $puser->getPartnerId());
         file_put_contents($this->lastPuserFile, $puser->getId());
     }
     return $pusers;
 }
Exemplo n.º 4
0
 /**
  * Code to be run after inserting to database
  * @param PropelPDO $con 
  */
 public function postInsert(PropelPDO $con = null)
 {
     PuserKuserPeer::setUseCriteriaFilter(false);
     $this->reload();
     PuserKuserPeer::setUseCriteriaFilter(true);
     kEventsManager::raiseEvent(new kObjectCreatedEvent($this));
     if ($this->copiedFrom) {
         kEventsManager::raiseEvent(new kObjectCopiedEvent($this->copiedFrom, $this));
     }
 }