You are here

function _faq_ask_get_term_field_name in FAQ_Ask 7

Helper function to find the term field on existing nodes

Parameters

object $node:

Return value

array field names

1 call to _faq_ask_get_term_field_name()
faq_ask_update_7002 in ./faq_ask.install
Add node/term data to faq_ask maintained term index for unpublished nodes

File

./faq_ask.module, line 2188
This module is an add-on to the FAQ module that allows users with the 'ask question' permission to create a question which will be queued for an 'expert' to answer.

Code

function _faq_ask_get_term_field_name($node) {
  $lang = $node->language;
  $fields = array();
  $node_fields = (array) $node;
  foreach (get_object_vars($node) as $field => $values) {
    if (isset($values[$lang][0])) {
      if (is_array($values[$lang][0])) {
        if (isset($values[$lang][0]['tid'])) {
          $fields[] = $field;
        }
      }
    }
  }
  return $fields;
}