function SystemStateEdit::checkObject

Same name in other branches
  1. 4.x src/Form/SystemStateEdit.php \Drupal\devel\Form\SystemStateEdit::checkObject()
  2. 5.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

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;
}