You are here

public function FieldChain::__wakeup in Corresponding Entity References 7.3

Magic post-unserialization callback. Provides every field in the chain with a reference to its parent (if any) and child (if any), effectively turning the chain into a doubly linked list.

1 call to FieldChain::__wakeup()
FieldChain::addField in field_object/includes/FieldChain.inc
Prepends a field instance to this chain. If $completed is passed, we'll try to find the parents of the instance and recurse upwards, building a tree of "routes" to the instance.

File

field_object/includes/FieldChain.inc, line 23
Contains the FieldChain class.

Class

FieldChain
@class A doubly linked list of FieldInstance objects.

Code

public function __wakeup() {
  foreach ($this->chain as $field) {
    if (isset($parent)) {
      $field
        ->parent($parent)
        ->child($field);
    }
    $parent = $field;
  }
}