original_string: private function getDataReference($item) {
      if ($this->isASleepingReference) {
        $this->referenceWake();
      }
      if ((is_a($item, '\Nymph\Entity') || is_a($item, '\SciActive\HookOverride'))
          && is_callable([$item, 'toReference'])) {
        // Convert entities to references.
        return $item->toReference();
      } elseif (is_array($item)) {
        // Recurse into lower arrays.
        return array_map([$this, 'getDataReference'], $item);
      } elseif (is_object($item)) {
        foreach ($item as &$curProperty) {
          $curProperty = $this->getDataReference($curProperty);
        }
        unset($curProperty);
      }
      // Not an entity or array, just return it.
      return $item;
    }
code: private function getDataReference($item) {
      if ($this->isASleepingReference) {
        $this->referenceWake();
      }
      if ((is_a($item, '\Nymph\Entity') || is_a($item, '\SciActive\HookOverride'))
          && is_callable([$item, 'toReference'])) {
        // Convert entities to references.
        return $item->toReference();
      } elseif (is_array($item)) {
        // Recurse into lower arrays.
        return array_map([$this, 'getDataReference'], $item);
      } elseif (is_object($item)) {
        foreach ($item as &$curProperty) {
          $curProperty = $this->getDataReference($curProperty);
        }
        unset($curProperty);
      }
      // Not an entity or array, just return it.
      return $item;
    }
code_tokens: private function getDataReference ( $ item ) { if ( $ this -> isASleepingReference ) { $ this -> referenceWake ( ) ; } if ( ( is_a ( $ item , '\Nymph\Entity' ) || is_a ( $ item , '\SciActive\HookOverride' ) ) && is_callable ( [ $ item , 'toReference' ] ) ) { // Convert entities to references. return $ item -> toReference ( ) ; } elseif ( is_array ( $ item ) ) { // Recurse into lower arrays. return array_map ( [ $ this , 'getDataReference' ] , $ item ) ; } elseif ( is_object ( $ item ) ) { foreach ( $ item as & $ curProperty ) { $ curProperty = $ this -> getDataReference ( $ curProperty ) ; } unset ( $ curProperty ) ; } // Not an entity or array, just return it. return $ item ; }
docstring: Convert entities to references and return the result.
  
  @param mixed $item The item to convert.
  @return mixed The resulting item.
docstring_tokens: Convert entities to references and return the result .