You are here

public function HostingFieldable::getFieldValueType in Aegir Objects 7.3

2 calls to HostingFieldable::getFieldValueType()
HostingFieldable::getEntityReference in traits/HostingFieldable.inc
Return the target of an entityreference field.
HostingFieldable::getFieldValue in traits/HostingFieldable.inc
Return the value of a field.

File

traits/HostingFieldable.inc, line 15
The HostingFieldable trait.

Class

HostingFieldable
@file The HostingFieldable trait.

Code

public function getFieldValueType($field, $type) {
  if (isset($this->node->{$field}) && $this->node->{$field}) {
    if (isset($this->node->{$field}[$this->node->language])) {
      return $this->node->{$field}[$this->node->language][0][$type];
    }
    else {
      return $this->node->{$field}[0][$type];
    }
  }
}