Exemplo n.º 1
0
 /**
  * RowCampaign constructor.
  * @param CampaignInterface $campaign
  * @param AdGroup $adGroup
  */
 public function __construct(CampaignInterface $campaign, AdGroup $adGroup)
 {
     foreach ($adGroup->getKeywords() as $keyword) {
         // キーワード行:固有のパラメータを設定して追加
         $container = new ColumnContainer();
         $container->setComponentType('キーワード');
         $container->setIsDelivery('オン');
         $container->setCampaignName($campaign->getCampaignName());
         $container->setAdGroupName($adGroup->getName());
         $container->setMatchType($this->getMatchTypeText($campaign->getMatchType()));
         $container->setKeyword($keyword);
         $container->setMaxCpc($campaign->getMaxCpc() . '(一括入札)');
         array_push($this->containers, $container);
     }
 }
Exemplo n.º 2
0
 /**
  * RowCampaign constructor.
  * @param CampaignInterface $campaign
  * @param AdGroup $adGroup
  */
 public function __construct(CampaignInterface $campaign, AdGroup $adGroup)
 {
     foreach ($adGroup->getKeywords() as $keyword) {
         // キーワード行:固有のパラメータを設定して追加
         $container = new ColumnContainer();
         $container->setCampaign($campaign->getCampaignName());
         $container->setAdGroup($adGroup->getName());
         $container->setMaxCpc('0');
         $container->setKeyword($keyword);
         $container->setCriterionType($this->getMatchTypeText($campaign->getMatchType()));
         $container->setCampaignStatus('Active');
         $container->setAdGroupStatus('Active');
         $container->setStatus('Active');
         array_push($this->containers, $container);
     }
 }
Exemplo n.º 3
0
 /**
  * RowCampaign constructor.
  * @param CampaignInterface $campaign
  * @param AdGroup $adGroup
  */
 public function __construct(CampaignInterface $campaign, AdGroup $adGroup)
 {
     // キーワード行:追加
     $ad_keyword = new RowKeyword($campaign, $adGroup);
     foreach ($ad_keyword->getContainers() as $container) {
         array_push($this->containers, $container);
     }
     // 広告行:固有のパラメータを設定して追加
     $container = new ColumnContainer();
     $container->setCampaignName($campaign->getCampaignName());
     $container->setAdGroupName($adGroup->getName());
     $container->setComponentType('広告');
     $container->setIsDelivery('オン');
     $container->setAdName($adGroup->getAdContents()->getAdInnerName());
     $container->setAdTitle($adGroup->getAdContents()->getHeadline());
     $container->setAdDescription1($adGroup->getAdContents()->getDescription1());
     $container->setAdDescription2($adGroup->getAdContents()->getDescription2());
     $container->setAdDisplayUrl($adGroup->getAdContents()->getDisplayUrl());
     $container->setAdLinkUrl($adGroup->getAdContents()->getLinkUrl());
     $container->setAdType('テキスト(15・19-19)');
     array_push($this->containers, $container);
 }
Exemplo n.º 4
0
 /**
  * RowCampaign constructor.
  * @param CampaignInterface $campaign
  * @param AdGroup $adGroup
  */
 public function __construct(CampaignInterface $campaign, AdGroup $adGroup)
 {
     // 広告行:固有のパラメータを設定して追加
     $container = new ColumnContainer();
     $container->setCampaign($campaign->getCampaignName());
     $container->setAdGroup($adGroup->getName());
     $container->setHeadline($adGroup->getAdContents()->getHeadline());
     $container->setDescriptionLine1($adGroup->getAdContents()->getDescription1());
     $container->setDescriptionLine2($adGroup->getAdContents()->getDescription2());
     $container->setDisplayUrl($adGroup->getAdContents()->getDisplayUrl());
     $container->setFinalUrl($adGroup->getAdContents()->getLinkUrl());
     $container->setDevicePreference('All');
     $container->setCampaignStatus('Active');
     $container->setAdGroupStatus('Active');
     $container->setStatus('Active');
     array_push($this->containers, $container);
     // キーワード行:追加
     $ad_keyword = new RowKeyword($campaign, $adGroup);
     foreach ($ad_keyword->getContainers() as $container) {
         array_push($this->containers, $container);
     }
 }
 /**
  * @param Product $product
  * @param AdContents $ad_contents
  */
 private function createAdGroupWithSearchWord(Product $product, AdContents $ad_contents)
 {
     $group_name = CsvContentsUtil::clipText($product->getName() . '×' . '検索ワード', 50);
     $group = new AdGroup($group_name, $ad_contents);
     $search_word = $product->getSearchWord();
     $keywords = preg_split('/[\\s 、,]+/u', $search_word, -1, PREG_SPLIT_NO_EMPTY);
     foreach ($keywords as $word) {
         $group->addKeyword($product->getName() . ' ' . $word);
     }
     if (!empty($group->getKeywords())) {
         array_push($this->ad_groups, $group);
     }
 }