I am interested to get the first 10 keywords in querying google adwords api.
function InsertKeywordsIntoDBTypePlacement(AdWordsUser $user) {
// Get the service, which loads the required classes.
$adGroupCriterionService = $user->GetService('AdGroupCriterionService', ADWORDS_VERSION);
$adwaccid = getAdWId($user);
// Create selector.
$selector = new Selector();
$selector->fields = array('KeywordText', 'KeywordMatchType', 'Id', 'ActiveViewCpmEnabled', 'AdGroupId', 'AgeRangeType',
'AppPaymentModelType', 'ApprovalStatus', 'BidModifier', 'BidType', 'BiddingStrategyId', 'BiddingStrategyName',
'BiddingStrategySource', 'BiddingStrategyType', 'CaseValue', 'ChannelId', 'ChannelName', 'CpcBid', 'CpcBidSource',
'CpmBid', 'CpmBidSource', 'CriteriaCoverage', 'CriteriaSamples', 'CriteriaType', 'CriterionUse', 'DestinationUrl',
'DisapprovalReasons', 'DisplayName', 'EnhancedCpcEnabled', 'ExperimentBidMultiplier',
'ExperimentDataStatus', 'ExperimentDeltaStatus', 'ExperimentId', 'FinalAppUrls', 'FinalMobileUrls', 'FinalUrls',
'FirstPageCpc', 'GenderType', 'IsKeywordAdRelevanceAcceptable', 'IsLandingPageQualityAcceptable', 'Labels',
'MobileAppCategoryId', 'Parameter', 'ParentCriterionId', 'PartitionType', 'Path', 'PlacementUrl', 'QualityScore',
'Status', 'SystemServingStatus', 'TopOfPageCpc', 'TrackingUrlTemplate', 'UrlCustomParameters', 'UserInterestId',
'UserInterestName', 'UserListId', 'UserListMembershipStatus', 'UserListName', 'VerticalId', 'VerticalParentId', 'VideoId', 'VideoName' );
$selector->ordering[] = new OrderBy('KeywordText', 'ASCENDING');
// Create predicates.
//$selector->predicates[] = new Predicate('AdGroupId', 'IN', array($adGroupId));
$selector->predicates[] =
new Predicate('CriteriaType', 'IN', array('PLACEMENT'));
//!!!!!HERE>>>>> it is not correct .....???? how to do this?
$selector->limit[] = new withLimit('10');
//<<<<<<
$keywordselection = $adGroupCriterionService->get($selector);
etc....