Segment::alias PHP Method

alias() public static method

Aliases the user id from a temporary id to a permanent one
public static alias ( array $message ) : boolean
$message array
return boolean whether the alias call succeeded
    public static function alias(array $message)
    {
        self::checkClient();
        $userId = !empty($message["userId"]);
        $previousId = !empty($message["previousId"]);
        self::assert($userId && $previousId, "Segment::alias() requires both userId and previousId");
        return self::$client->alias($message);
    }

Usage Example

示例#1
0
 function testAlias()
 {
     $this->assertTrue(Segment::alias(array("previousId" => "previous-id", "userId" => "user-id")));
 }