You are here

function PEAR::_checkDelExpect in Flickr API 5

This method checks unsets an error code if available

@access private @since PHP 4.3.0

Parameters

mixed error code:

Return value

bool true if the error code was unset, false otherwise

1 call to PEAR::_checkDelExpect()
PEAR::delExpect in phpFlickr/PEAR/PEAR.php
This method deletes all occurences of the specified element from the expected error codes stack.

File

phpFlickr/PEAR/PEAR.php, line 424

Class

PEAR
Base class for other PEAR classes. Provides rudimentary emulation of destructors.

Code

function _checkDelExpect($error_code) {
  $deleted = false;
  foreach ($this->_expected_errors as $key => $error_array) {
    if (in_array($error_code, $error_array)) {
      unset($this->_expected_errors[$key][array_search($error_code, $error_array)]);
      $deleted = true;
    }

    // clean up empty arrays
    if (0 == count($this->_expected_errors[$key])) {
      unset($this->_expected_errors[$key]);
    }
  }
  return $deleted;
}