Hi

I'm migrating to the new Adwords API and trying to create a text label. At 
the bottom my code, but this gives an error

*Fatal error*: Cannot access empty property in 
*[..]/Google/AdsApi/AdWords/v201708/cm/Label.php* on line *172*

Which relates to:
public function __set($var, $value)
   {
     $this->{$this->parameterMap[$var]} = $value;
   }
in Label.php.

for ease, parameterMap is defined as:
private $parameterMap = ['Label.Type' => 'LabelType'];



*My code:*

public function createLabel($name){
        $service = $this->adWordsServices->get($this->session, 
LabelService::class);

        // Create label
        $txt = new TextLabel();
        $txt->setName = $name;
        
        // Create operation.
        $operation = new LabelOperation();
        $operation->setOperand = $txt;
        $operation->setOperator = 'ADD';
        $operations[] = $operation;
        
        // Make the mutate request.
        $result = $service->mutate($operations);
        return $result->value[0];
    }

I've googled and searched the forums but cannot find anything relating to 
this issue. Any pointers or suggestions gratefully received.

Thanks

Zac

-- 

------------------------------
https://www.flipflopshop.co.uk/
*Life is better in flip flops*

<https://www.facebook.com/cornwallflipflopshop> 
<https://twitter.com/_flipflopshop> 
<https://instagram.com/flipflopshop.co.uk/> 
<https://www.pinterest.com/flipflopshopuk/> 
<https://plus.google.com/u/0/106348222284430952728/posts>



http://www.jamhill.co.uk/
T: +44 (0)203 1376426

This email and any attachments are confidential and intended solely for the 
addressee and may also be privileged or exempt from disclosure under 
applicable law. If you are not the addressee, or have received this email 
in error, please notify the sender immediately, delete it from your system 
and do not copy, disclose or otherwise act upon any part of this email or 
its attachments.

Internet communications are not guaranteed to be secure or without viruses. 
JamHill Ltd does not accept responsibility for any loss arising from 
unauthorised access to, or interference with, any Internet communications 
by any third party, or from the transmission of any viruses. Replies to 
this email may be monitored by the JamHill Ltd for operational or business 
reasons.

Any opinion or other information in this email or its attachments that does 
not relate to the business of JamHill Ltd is personal to the sender and is 
not given or endorsed by the JamHill Ltd.

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/808f0ea5-492e-4018-bf10-c73a4437e59d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
  • Create Text Lab... Zac Hillier

Reply via email to