/**
  * The constructor.
  *
  * @param int $registrationUid UID of the registration record, must be > 0
  */
 public function __construct($registrationUid = 0)
 {
     if ($registrationUid > 0) {
         $dbResult = tx_oelib_db::select('*', $this->tableName, 'uid = ' . $registrationUid);
     } else {
         $dbResult = FALSE;
     }
     $contentObject = new tslib_cObj();
     $contentObject->start(array());
     parent::__construct($contentObject, $dbResult);
 }
示例#2
0
 public function testCreateFromDbResult()
 {
     $dbResult = tx_oelib_db::select('*', 'tx_seminars_test', 'uid = ' . $this->fixtureUid);
     $test = new tx_seminars_tests_fixtures_OldModel_Testing(0, $dbResult);
     self::assertTrue($test->isOk());
 }
示例#3
0
 /**
  * Sets the iterator to the first object, using additional
  * query parameters from $this->queryParameters for the DB query.
  * The query works so that the column names are *not*
  * prefixed with the table name.
  *
  * @return void
  */
 public function rewind()
 {
     if ($this->isRewound) {
         return;
     }
     // frees old results if there are any
     if ($this->dbResult) {
         $GLOBALS['TYPO3_DB']->sql_free_result($this->dbResult);
         // We don't need to null out $this->dbResult as it will be
         // overwritten immediately anyway.
     }
     $this->dbResult = tx_oelib_db::select($this->dbTableName . '.*', $this->dbTableName . $this->additionalTableNames, $this->queryParameters . $this->enabledFieldsQuery, $this->groupBy, $this->orderBy, $this->limit);
     $this->createItemFromDbResult();
     $this->isRewound = TRUE;
 }
 /**
  * Removes the given registration (if it exists and if it belongs to the
  * currently logged-in FE user).
  *
  * @param int $uid the UID of the registration that should be removed
  * @param tslib_pibase $plugin a live plugin object
  *
  * @return void
  */
 public function removeRegistration($uid, tslib_pibase $plugin)
 {
     if (!tx_seminars_OldModel_Abstract::recordExists($uid, 'tx_seminars_attendances')) {
         return;
     }
     $this->registration = t3lib_div::makeInstance('tx_seminars_registration', $plugin->cObj, tx_oelib_db::select('*', 'tx_seminars_attendances', 'uid = ' . $uid . tx_oelib_db::enableFields('tx_seminars_attendances')));
     if ($this->registration->getUser() !== $this->getFeUserUid()) {
         return;
     }
     /** @var $user tx_seminars_Model_FrontEndUser */
     $user = tx_oelib_FrontEndLoginManager::getInstance()->getLoggedInUser('tx_seminars_Mapper_FrontEndUser');
     foreach ($this->getHooks() as $hook) {
         if (method_exists($hook, 'seminarRegistrationRemoved')) {
             $hook->seminarRegistrationRemoved($this->registration, $user);
         }
     }
     tx_oelib_db::update('tx_seminars_attendances', 'uid = ' . $uid, array('hidden' => 1, 'tstamp' => $GLOBALS['SIM_EXEC_TIME']));
     $this->notifyAttendee($this->registration, $plugin, 'confirmationOnUnregistration');
     $this->notifyOrganizers($this->registration, 'notificationOnUnregistration');
     $this->fillVacancies($plugin);
 }
示例#5
0
 public function testCreateFromDbResult()
 {
     $dbResult = tx_oelib_db::select('*', 'tx_seminars_categories', 'uid = ' . $this->fixtureUid);
     $this->fixture = new tx_seminars_OldModel_Category(0, $dbResult);
     self::assertTrue($this->fixture->isOk());
 }