Registry::exists PHP Method

exists() static public method

Return TRUE if object exists in catalog
static public exists ( $key ) : boolean
$key string
return boolean
    static function exists($key)
    {
        return isset(self::$table[$key]);
    }

Usage Example

 /**
  * handlePagina	controleer of er inloggegevens zijn gepost, zo ja, log in en redirect naar homepage
  * @throws WebsiteException
  */
 public function handlePagina()
 {
     // standaard wordt dit scherm getoond
     $oResult = $this;
     if (Registry::exists('Bezoeker')) {
         $oGebruiker = Registry::get('Bezoeker');
     } else {
         // gebruiker moet al bestaan, dus fout
         throw new WebsiteException('Gebruiker object bestaat niet');
     }
     if (!$oGebruiker->isIngelogd()) {
         // gebruiker was nog niet ingelogd
         $oValidator = InputValidator::instantiate();
         $oValidator->addValidation('gebruiker', InputValidator::SCOPE_POST, InputValidator::TYPE_STRING, true);
         $oValidator->addValidation('wachtwoord', InputValidator::SCOPE_POST, InputValidator::TYPE_STRING, true);
         if ($oValidator->validateAll() == InputValidator::RESULT_OK) {
             // inloggegevens gepost
             if ($oGebruiker->login($oValidator->getValue('gebruiker', InputValidator::SCOPE_POST), $oValidator->getValue('wachtwoord', InputValidator::SCOPE_POST))) {
                 // login gelukt
                 $oResult = SchermGenerator::genereerSchermObject(SchermGenerator::BEHEER);
             }
         }
     } else {
         // gebruiker was al eerder ingelogd, ga naar homepage
         $oResult = SchermGenerator::genereerSchermObject(SchermGenerator::BEHEER);
     }
     return $oResult;
 }
All Usage Examples Of Registry::exists