public static function getRiverObject(ElggRiverItem $river) {

		if (!$river instanceof ElggRiverItem) {
			return false;
		}

		$object = $river->getObjectEntity();

		$views = self::getActionableViews();

		if (in_array($river->view, $views)) {

			// wrapping this in ignore access so that we do not accidentally create duplicate
			// river objects
			$ia = elgg_set_ignore_access(true);

			$guid = InteractionsCache::getInstance()->getGuidFromRiverId($river->id);

			if (!$guid) {
				$object = InteractionsService::createActionableRiverObject($river);
				$guid = $object->guid;
			}

			elgg_set_ignore_access($ia);

			$object = get_entity($guid);
		}

		if ($object instanceof ElggEntity) {
			$object->setVolatileData('river_item', $river);
		}

		return $object;
	}