public function __construct($stats, Creative $creative) { parent::__construct($stats); $this->object_id =& $stats->adgroup_id; if (!property_exists($creative, 'body')) { $creative->body = $creative->name; $creative->name = $stats->adgroup_name; $creative->title = $stats->adgroup_name; } if ($creative->image_url == null) { $creative->image_url = 'https://graph.facebook.com/' . $creative->object_id . '/picture?type=normal'; } $this->name =& $creative->name; $this->body =& $creative->body; $this->image_url =& $creative->image_url; $this->title =& $creative->title; $this->comment =& $stats->actions[$this->findActionIndex($stats->actions, 'comment')]->value; $this->like =& $stats->actions[$this->findActionIndex($stats->actions, 'like')]->value; $this->link_click =& $stats->actions[$this->findActionIndex($stats->actions, 'link_click')]->value; $this->photo_view =& $stats->actions[$this->findActionIndex($stats->actions, 'photo_view')]->value; $this->post =& $stats->actions[$this->findActionIndex($stats->actions, 'post')]->value; $this->post_like =& $stats->actions[$this->findActionIndex($stats->actions, 'post_like')]->value; $this->video_play =& $stats->actions[$this->findActionIndex($stats->actions, 'video_play')]->value; $this->video_view =& $stats->actions[$this->findActionIndex($stats->actions, 'video_view')]->value; }
public function __construct($stats) { parent::__construct($stats); $this->object_id =& $stats->campaign_id; $this->name =& $stats->campaign_name; }