Esempio n. 1
0
    public function closeAllThreads($sAppUid)

    {

        try {

            $c = new Criteria();

            $c->add(AppThreadPeer::APP_UID, $sAppUid);

            $c->add(AppThreadPeer::APP_THREAD_STATUS, 'OPEN');

            $rowObj = AppThreadPeer::doSelect($c);

            foreach ($rowObj as $appThread) {

                $appThread->setAppThreadStatus('CLOSED');

                if ($appThread->Validate()) {

                    $appThread->Save();

                } else {

                    $msg = '';

                    foreach ($this->getValidationFailures() as $objValidationFailure) {

                        $msg .= $objValidationFailure->getMessage() . "<br/>";

                    }

                    throw (new PropelException('The row cannot be created!', new PropelException($msg)));

                }

            }

            //update searchindex

            if ($this->appSolr != null) {

                $this->appSolr->updateApplicationSearchIndex($sAppUid);

            }

        } catch (exception $e) {

            throw ($e);

        }

    }
 /**
  * Retrieve object using using composite pkey values.
  * @param string $app_uid
  * @param int $app_thread_index
  * @param      Connection $con
  * @return     AppThread
  */
 public static function retrieveByPK($app_uid, $app_thread_index, $con = null)
 {
     if ($con === null) {
         $con = Propel::getConnection(self::DATABASE_NAME);
     }
     $criteria = new Criteria();
     $criteria->add(AppThreadPeer::APP_UID, $app_uid);
     $criteria->add(AppThreadPeer::APP_THREAD_INDEX, $app_thread_index);
     $v = AppThreadPeer::doSelect($criteria, $con);
     return !empty($v) ? $v[0] : null;
 }