protected function isValuedAssociation($field, array $associationTypes) { $association = $this->getAssociation($field); if ($association) { return in_array($association->type, $associationTypes); } }