Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » MASHUP: Combining results from 2 DataObjecySets

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

Page: 1
Go to End
Author Topic: 1661 Views
  • freeyland
    Avatar
    Community Member
    22 Posts

    MASHUP: Combining results from 2 DataObjecySets Link to this post

    Suppose in mashup:

          $yw = new RestfulService($feed,$location_name,$cash_lifetime);
          $params = array(
                "u"=>"C",
                "p"=>$YahooCode
          );
          $yw->setQueryString($params);
          $conn = $yw->connect();
          
          $yahooWeather = $yw->searchAttributes($conn, "//yweather:condition");
          
          Debug::show($yahooWeather);
          return $yahooWeather;

    Suppose if I want to get data from an other attribute:
    $yahooWeather2 = $yw->searchAttributes($conn, "//yweather:forecast");
    Can I combine yahooWeather and yahooWeather2 to return 1output?

  • freeyland
    Avatar
    Community Member
    22 Posts

    Re: MASHUP: Combining results from 2 DataObjecySets Link to this post

    I tried with merge:
    $yahooWeather->merge($yahooWeather2);

    The problem is that when using in the template (Control) , you will have 2 arrayresults. How can we combine them into 1 array result?

    1661 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.