You are here

public function ACKEntityField::objectRealms in Access Control Kit 7

Overrides AccessControlKitHandler::objectRealms().

Overrides AccessControlKitHandler::objectRealms

File

handlers/ack_entity_field.inc, line 51
Contains the handler class for Field API fields on entities.

Class

ACKEntityField
Controls access to a fieldable entity based on a Field API field.

Code

public function objectRealms($object_type, $object) {
  $values = array();
  if (!empty($this->fieldName)) {
    $items = field_get_items($object_type, $object, $this->fieldName);
    if (is_array($items)) {
      foreach ($items as $item) {
        if (isset($item[$this->fieldValueKey])) {
          $values[] = $item[$this->fieldValueKey];
        }
      }
    }
  }
  return $values;
}