public function isHidden()
{
if (!$this->hasFieldType()) {
return false;
}
if ($parentField = $this->getParentField()) {
if ($parentField->isHidden()) {
return true;
}
}
if ($this->getNeedValue()) {
$againstField = null;
if ($againstFieldName = $this->getAgainstField()) {
if ($this->getForm()) {
$againstField = $this->getForm()->getField($againstFieldName);
}
} else {
$againstField = $this->getParentField();
}
if ($againstField) {
if ($againstField->isHidden()) {
return true;
}
if (is_array($this->getNeedValue())) {
if (!in_array($againstField->getValue(), $this->getNeedValue())) {
return true;
}
} else {
if ($againstField->getValue() != $this->getNeedValue()) {
return true;
}
}
}
}
return false;
}