function DrupalDefaultEntityController::filterId

Callback for array_filter that removes non-integer IDs.

File

includes/entity.inc, line 256

Class

DrupalDefaultEntityController
Default implementation of DrupalEntityControllerInterface.

Code

protected function filterId($id) {
    // ctype_digit() is used here instead of a strict comparison as sometimes
    // the id is passed as a string containing '0' which may represent a bug
    // elsewhere but would fail with a strict comparison.
    return is_numeric($id) && $id == (int) $id && ctype_digit((string) $id);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.