Google\Cloud\Datastore\Query\Query::hasAncestor PHP Method

hasAncestor() public method

Keys can be provided either via a {@see \Google\Cloud\Datastore\Key} object, or by providing a kind, identifier and (optionally) an identifier type. Example: $key = $datastore->key('Person', 'Bob'); $query->hasAncestor($key); Specifying an identifier type $key = $datastore->key('Robots', '1337', [ 'identifierType' => Key::TYPE_NAME ]); $query->hasAncestor($key);
public hasAncestor ( Key $key ) : Query
$key Google\Cloud\Datastore\Key The ancestor Key instance.
return Query
    public function hasAncestor(Key $key)
    {
        $this->filter('__key__', self::OP_HAS_ANCESTOR, $key);
        return $this;
    }