You are here

protected function SystemStateEdit::checkObject in Devel 8

Same name and namespace in other branches
  1. 8.3 src/Form/SystemStateEdit.php \Drupal\devel\Form\SystemStateEdit::checkObject()
  2. 8.2 src/Form/SystemStateEdit.php \Drupal\devel\Form\SystemStateEdit::checkObject()
  3. 4.x src/Form/SystemStateEdit.php \Drupal\devel\Form\SystemStateEdit::checkObject()

Helper function to determine if a variable is or contains an object.

Parameters

$data: Input data to check

Return value

bool TRUE if the variable is not an object and does not contain one.

1 call to SystemStateEdit::checkObject()
SystemStateEdit::buildForm in src/Form/SystemStateEdit.php
Form constructor.

File

src/Form/SystemStateEdit.php, line 171

Class

SystemStateEdit
Form API form to edit a state.

Namespace

Drupal\devel\Form

Code

protected function checkObject($data) {
  if (is_object($data)) {
    return FALSE;
  }
  if (is_array($data)) {

    // If the current object is an array, then check recursively.
    foreach ($data as $value) {

      // If there is an object the whole container is "contaminated"
      if (!$this
        ->checkObject($value)) {
        return FALSE;
      }
    }
  }

  // All checks pass
  return TRUE;
}