public static function fromString($ref) { $parts = explode(self::REF_DELIMITER, $ref, 3); if (count($parts) !== 3) { throw new UnexpectedValueException("Invalid ref string: " . $ref); } return new self($parts[0], $parts[1], $parts[2]); }
/** * Get all refs to an entity * * @param string $key Entity ref key * @return Ref[] */ public function getRefs($key) { $current = $this->worker_pool->execute(new Command('retrieve_index', ['key' => $key])); array_walk($current, function (&$item) { $item = Ref::fromString($item); }); return $current; }