本文整理汇总了PHP中Campaign类的典型用法代码示例。如果您正苦于以下问题:PHP Campaign类的具体用法?PHP Campaign怎么用?PHP Campaign使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Campaign类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct($options = null)
{
parent::__construct($options);
$emailCategoryOptionList = array('Invite non-sparks to join campaign' => $this->getView()->translate('Admin_Non-Sparks_Invitation'), 'Invite sparks to join campaign' => $this->getView()->translate('Admin_Sparks_Invitation'), 'Send mail to sparks' => $this->getView()->translate('Admin_Send_Mail_To_Sparks'));
$emailCategory = new Zend_Form_Element_Select('emailCategory');
$emailCategory->setMultiOptions($emailCategoryOptionList);
$emailList = new Zend_Form_Element_Textarea('emailList');
$emailList->setAttribs(array('rows' => 5, 'cols' => 150, 'onChange' => 'datetable()'))->addFilter('StripTags')->addFilter('StringTrim')->addValidators(array(array('StringLength', false, array(0, 65535))));
$subject = new Zend_Form_Element_Text('subject');
$subject->setAttribs(array('size' => 150))->addFilter('StringTrim');
$message = new Zend_Form_Element_Textarea('message');
$message->setAttribs(array('rows' => 30, 'cols' => 150))->addFilter('StripTags')->addFilter('StringTrim')->addValidators(array(array('StringLength', false, array(0, 65535))));
$optionList = array();
$campaign = new Campaign();
$campaigns = $campaign->fetchAll(null, "id desc", null, null);
foreach ($campaigns as $campaign) {
$optionList[$campaign->id] = $campaign->name;
}
$optionList['0'] = $this->getView()->translate('ADMIN_NOT_AUTO_INVITATION');
$campaignId = new Zend_Form_Element_Select('campaignId');
$campaignId->setMultiOptions($optionList);
$code_source = new Zend_Form_Element_Text('code_source');
$code_source->addFilter('StringTrim');
$submit = new Zend_Form_Element_Submit('submit');
$submit->setLabel($this->getView()->translate('INVITATION_MAIL_SEND'));
$this->addElements(array($emailCategory, $emailList, $subject, $message, $campaignId, $code_source, $submit));
}
开发者ID:omusico,项目名称:wildfire_php,代码行数:27,代码来源:CampaignInvitationMailForm.php
示例2: getIndex
public function getIndex()
{
$campaign = new Campaign();
$image = $campaign->getCampaignImage();
$users = new Users();
$member = $users->getRecentUsers();
$this->layout->foot = View::make("landing.foot")->with(array('data' => $image, 'data2' => $member));
$this->layout->title = "Welcome to Sagip.ph";
if (Session::has('userid')) {
$username = Session::get('username');
$logstatus = true;
$userid = Session::get('userid');
$profile = new Profile();
$pic = "#";
$result = $profile->getProfile($userid);
if ($result) {
$pic = $result->profilepic;
}
$data = array('username' => $username, 'logstatus' => $logstatus, 'profilepic' => $pic);
$campaign = new Campaign();
$data2 = $campaign->getCampaignHome();
$this->layout->head = View::make("landing.head")->with($data);
$this->layout->body = View::make("landing.bodycontributordash")->with($data);
} else {
$logstatus = false;
$data = array('logstatus' => $logstatus);
$campaign = new Campaign();
$data2 = $campaign->getCampaignHome();
$this->layout->head = View::make("landing.head")->with($data);
$this->layout->body = View::make("landing.bodycontributordash")->with($data);
}
}
开发者ID:centaurustech,项目名称:sagip,代码行数:32,代码来源:ContributorController.php
示例3: updateCampaign
/**
* Update a specific email campaign
* @param string $accessToken - Constant Contact OAuth2 access token
* @param Campaign $campaign - Campaign to be updated
* @return Campaign
*/
public function updateCampaign($accessToken, Campaign $campaign)
{
$baseUrl = Configs::get('endpoints.base_url') . sprintf(Configs::get('endpoints.campaign'), $campaign->id);
$url = $this->buildUrl($baseUrl);
$response = parent::getRestClient()->put($url, parent::getHeaders($accessToken), $campaign->toJson());
return Campaign::create(json_decode($response->body, true));
}
开发者ID:CreatrixeNew,项目名称:carparking,代码行数:13,代码来源:EmailMarketingService.php
示例4: setup
public function setup()
{
global $current_user;
$current_user = SugarTestUserUtilities::createAnonymousUser();
//for the purpose of this test, we need to create a campaign and relate it to a campaign tracker object
//create campaign
$c = new Campaign();
$c->name = 'CT test ' . time();
$c->campaign_type = 'Email';
$c->status = 'Active';
$timeDate = new TimeDate();
$c->end_date = $timeDate->to_display_date(date('Y') + 1 . '-01-01');
$c->assigned_id = $current_user->id;
$c->team_id = '1';
$c->team_set_id = '1';
$c->save();
$this->campaign = $c;
//create campaign tracker
$ct = new CampaignTracker();
$ct->tracker_name = 'CampaignTrackerTest' . time();
$ct->tracker_url = 'sugarcrm.com';
$ct->campaign_id = $this->campaign->id;
$ct->save();
$this->campaign_tracker = $ct;
}
开发者ID:jgera,项目名称:sugarcrm_dev,代码行数:25,代码来源:CampaignTrackersTest.php
示例5: queryByCampaign
/**
*
* @param Campaign $campaign
* @param bool $fetch_user
* @return Doctrine_Query
*/
public function queryByCampaign(Campaign $campaign, $fetch_user = true)
{
$query = $this->createQuery('cr')->where('cr.campaign_id = ?', $campaign->getId());
if ($fetch_user) {
$query->leftJoin('cr.User u')->addSelect('cr.*, u.*');
}
return $query;
}
开发者ID:uniteddiversity,项目名称:policat,代码行数:14,代码来源:CampaignRightsTable.class.php
示例6: build
/**
* @param Campaign $campaign
* @param $locale
* @return string
*/
public function build(Campaign $campaign, $locale)
{
//it's simple, just load all the shit! :-)
$campaign->load(['translations', 'widgets', 'widgets.translations', 'widgets.resource', 'widgets.otherResource', 'widgets.image', 'widgets.imageLeft', 'widgets.imageRight']);
$campaign->widgets->setData();
$translation = $campaign->translate($locale);
return view('marketing::newsletter.campaign', ['translation' => $translation, 'campaign' => $campaign, 'locale' => $locale])->render();
}
开发者ID:jaffle-be,项目名称:framework,代码行数:13,代码来源:CampaignBuilder.php
示例7: queryByCampaign
/**
*
* @param Campaign $campaign
* @return Doctrine_Query
*/
public function queryByCampaign(Campaign $campaign, $active_only = false, $deleted_too = false)
{
$query = $this->createQuery('ml')->orderBy('ml.id')->where('ml.campaign_id = ?', $campaign->getId());
if ($active_only) {
$query->andWhere('ml.status = ?', MailingListTable::STATUS_ACTIVE);
} else {
if (!$deleted_too) {
$query->andWhere('ml.status != ?', MailingListTable::STATUS_DELETED);
}
}
return $query;
}
开发者ID:uniteddiversity,项目名称:policat,代码行数:17,代码来源:MailingListTable.class.php
示例8: sendCampaign
public function sendCampaign()
{
// get abandoned cart :
$sql = "SELECT * FROM (\n\t\tSELECT\n\t\tCONCAT(LEFT(c.`firstname`, 1), '. ', c.`lastname`) `customer`, a.id_cart total, ca.name carrier, c.id_customer, a.id_cart, a.date_upd,a.date_add,\n\t\t\t\tIF (IFNULL(o.id_order, 'Non ordered') = 'Non ordered', IF(TIME_TO_SEC(TIMEDIFF('" . date('Y-m-d H:i:s') . "', a.`date_add`)) > 86400, 'Abandoned cart', 'Non ordered'), o.id_order) id_order, IF(o.id_order, 1, 0) badge_success, IF(o.id_order, 0, 1) badge_danger, IF(co.id_guest, 1, 0) id_guest\n\t\tFROM `" . _DB_PREFIX_ . "cart` a \n\t\t\t\tJOIN `" . _DB_PREFIX_ . "customer` c ON (c.id_customer = a.id_customer)\n\t\t\t\tLEFT JOIN `" . _DB_PREFIX_ . "currency` cu ON (cu.id_currency = a.id_currency)\n\t\t\t\tLEFT JOIN `" . _DB_PREFIX_ . "carrier` ca ON (ca.id_carrier = a.id_carrier)\n\t\t\t\tLEFT JOIN `" . _DB_PREFIX_ . "orders` o ON (o.id_cart = a.id_cart)\n\t\t\t\tLEFT JOIN `" . _DB_PREFIX_ . "connections` co ON (a.id_guest = co.id_guest AND TIME_TO_SEC(TIMEDIFF('" . date('Y-m-d H:i:s') . "', co.`date_add`)) < 1800)\n\t\t) AS toto WHERE id_order='Abandoned cart'";
$currency = Context::getContext()->currency->sign;
$defaultLanguage = new Language((int) Configuration::get('PS_LANG_DEFAULT'));
$abandoned_carts = Db::getInstance()->ExecuteS($sql);
// get all available campaigns
$sqlCampaigns = 'SELECT * FROM `' . _DB_PREFIX_ . 'campaign` WHERE active=1';
$allCampaigns = Db::getInstance()->ExecuteS($sqlCampaigns);
// loop on all abandoned carts
foreach ($abandoned_carts as $abncart) {
// loop on all available campaigns
foreach ($allCampaigns as $camp) {
$cartIsOnCampaign = $this->checkIfCartIsOnCampaign($abncart['date_add'], $camp['execution_time_day'], $camp['execution_time_hour']);
if ($cartIsOnCampaign) {
$id_lang = (int) Configuration::get('PS_LANG_DEFAULT');
$customer = new Customer($abncart['id_customer']);
$cR = new CartRule($camp['id_voucher'], $id_lang);
$cart = new Cart($abncart['id_cart']);
$products = $cart->getProducts();
$campM = new Campaign($camp['id_campaign']);
if (!empty($products)) {
$cart_content = $campM->getCartContentHeader();
} else {
$cart_content = '';
}
foreach ($products as $prod) {
$p = new Product($prod['id_product'], true, $id_lang);
$price_no_tax = Product::getPriceStatic($p->id, false, null, 2, null, false, true, 1, false, null, $abncart['id_cart'], null, $null, true, true, null, false, false);
$total_no_tax = $prod['cart_quantity'] * $price_no_tax;
$images = Image::getImages((int) $id_lang, (int) $p->id);
$link = new Link();
$cart_content .= '<tr >
<td align="center" ><img src="' . $link->getImageLink($p->link_rewrite, $images[0]['id_image']) . '" width="80"/></td>
<td align="center" ><a href="' . $link->getProductLink($p) . '"/>' . $p->name . '</a></td>
<td align="center" >' . Tools::displayprice($price_no_tax) . '</td>
<td align="center" >' . $prod['cart_quantity'] . '</td>
<td align="center" >' . Tools::displayprice($total_no_tax) . '</td>
</tr>';
}
$tpl_vars = array('{firstname}' => $customer->firstname, '{lastname}' => $customer->lastname, '{coupon_name}' => $cR->name, '{coupon_code}' => $cR->code, '{cart_content}' => $cart_content, '{coupon_value}' => $camp['voucher_amount_type'] == 'percent' ? $cR->reduction_percent . '%' : $currency . $cR->reduction_amount, '{coupon_valid_to}' => date('d/m/Y', strtotime($cR->date_to)), '{campaign_name}' => $camp['name']);
$path = _PS_ROOT_DIR_ . '/modules/superabandonedcart/mails/';
// send email to customer :
Mail::Send($id_lang, $campM->getFileName(), $camp['name'], $tpl_vars, $customer->email, null, null, null, null, null, $path, false, Context::getContext()->shop->id);
// Email to admin :
Mail::Send($id_lang, $campM->getFileName(), Mail::l(sprintf('Email sent to %s %s for campaign %s', $customer->lastname, $customer->firstname, $camp['name'])), $tpl_vars, Configuration::get('PS_SHOP_EMAIL'), null, null, null, null, null, $path, false, Context::getContext()->shop->id);
// echo 'ID ' . $abncart['id_cart'];
}
}
}
}
开发者ID:prestarocket,项目名称:superabandonedcart,代码行数:52,代码来源:launch_campaings.php
示例9: adminexportdataAction
function adminexportdataAction()
{
$this->_helper->layout->disableLayout();
$idValue = explode('&', $this->_request->getParam('id'));
$this->campaign_id = $idValue[0];
$campaignModel = new Campaign();
$this->view->campaign = $campaignModel->fetchRow('id = ' . $this->campaign_id);
$this->view->flag = 0;
if ($this->_request->isPost()) {
$postData = $this->_request->getPost();
$this->view->flag = 1;
$db = Zend_Registry::get('db');
$select = $db->select();
$select->from('campaign', null);
$select->join('campaign_invitation', 'campaign.id = campaign_invitation.campaign_id', array('create_date', 'state'));
$select->join('consumer', "consumer.id = campaign_invitation.consumer_id");
switch ($postData['action']) {
case 'all':
$select->join('campaign_participation', 'campaign_invitation.id = campaign_participation.campaign_invitation_id', array('accept_date', 'state'));
break;
case 'sent':
$select->join('campaign_participation', 'campaign_invitation.id = campaign_participation.campaign_invitation_id and campaign_participation.state="KIT SENT"', array('accept_date', 'state'));
break;
case 'notsent':
$select->join('campaign_participation', 'campaign_invitation.id = campaign_participation.campaign_invitation_id and campaign_participation.state<>"KIT SENT"', array('accept_date', 'state'));
break;
}
$select->where('campaign_invitation.campaign_id = ?', $this->campaign_id)->where('consumer.pest is null or consumer.pest != 1');
$campaignParticipations = $db->fetchAll($select);
// Zend_Debug::dump($campaignParticipations);die();
$campaignUsers = array();
$file = $this->campaign_id . '_' . date('Y-m-d_H_i_s') . "participation.csv";
if ($campaignParticipations) {
$i = 0;
foreach ($campaignParticipations as $val) {
$campaignUsers[] = array($i, $val['name'], $val['email'], $val['login_phone'], $val['recipients_name'], $val['province'], $val['city'], $val['address1'], $val['phone'], $val['qq'], $val['id'], $val['create_date'], $val['accept_date']);
$i++;
}
$header = array('No.', 'Name', 'Email', 'Login_phone', 'Recipients_name', 'Province', 'City', 'Address1', 'Phone', 'QQ', 'UserID', 'InvitateDate', 'AcceptedDate');
$handle = fopen(dirname(dirname(dirname(__FILE__))) . '/public/csv/' . $file, "w");
// Zend_Debug::dump(dirname ( dirname ( dirname ( __FILE__ ) ) ) . '/public/csv/' . $file);die();
fputcsv($handle, $header);
foreach ($campaignUsers as $line) {
fputcsv($handle, $line);
}
fclose($handle);
}
$this->view->file = file_exists(dirname(dirname(dirname(__FILE__))) . '/public/csv/' . $file) ? dirname(dirname(dirname(__FILE__))) . '/public/csv/' . $file : false;
$this->view->filename = $file;
}
}
开发者ID:omusico,项目名称:wildfire_php,代码行数:51,代码来源:CampaignparticipationController.php
示例10: saveCampaign
public function saveCampaign(Campaign $campaign)
{
$data = $campaign->getArrayData();
$id_campana = (int) $campaign->id_campana;
if ($id_campana == 0) {
$this->tableGateway->insert($data);
} else {
if ($this->getCampaign($id_campana)) {
$this->tableGateway->update($data, array('ID_CAMPANA' => $id_campana));
} else {
//throw new \Exception("Could not find row $uid");
return null;
}
}
}
开发者ID:rodrigogk87,项目名称:djme,代码行数:15,代码来源:GCampaignTable.php
示例11: run
/**
* @see BaseJob::run()
*/
public function run()
{
// we need either this or need to call forget() on each campaign we are processing inside tests
Campaign::forgetAll();
$util = new CampaignItemsUtil();
return $util->generateCampaignItemsForDueCampaigns();
}
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:10,代码来源:CampaignGenerateDueCampaignItemsJob.php
示例12: get_instance
public static function get_instance()
{
if (self::$campaign == NULL) {
self::$campaign = new Campaign();
}
return self::$campaign;
}
开发者ID:junctiontech,项目名称:dbho,代码行数:7,代码来源:class_campaign.php
示例13: viewAction
function viewAction()
{
$clearArray = array('flags');
$this->filter($clearArray);
if (empty($this->params)) {
$today = date("d.m.Y");
$this->params['dates'] = $today . '-' . $today;
}
$pagination = new Pagination(array('action' => $this->action, 'controller' => $this->controller, 'params' => $this->params, 'ajax' => true));
$models = AFActiveDataProvider::models('ProspectEmail', $this->params, $pagination);
$dataProvider = $models->getAll();
$filterFields = $models->getoutFilterFields($clearArray, array('dates'));
// set ajax table
if (AF::isAjaxRequestModels()) {
$this->view->includeFile('_table', array('application', 'views', 'emails'), array('access' => $this->access, 'controller' => $this->controller, 'dataProvider' => $dataProvider, 'pagination' => $pagination, 'filterFields' => $filterFields));
die;
}
$campaigns = Campaign::model()->cache()->findAllInArray();
$templates = Template::model()->cache()->findAllInArray();
$flags = ProspectEmail::getEmailFlags();
/*
$campaignsFilter = $models->getFilterCampaigns();
$templatesFilter = $models->getFilterTemplates();
$flagsFilter = $models->getFilterFlags();
*/
Assets::css('jquery-ui');
Assets::js('jquery-ui');
Assets::js('dateRange/jquery.daterange');
Assets::js('ajax_table');
Assets::js('af_input_field');
$this->addToPageTitle(__('prospect_emails'));
$this->render('view', array('dataProvider' => $dataProvider, 'pagination' => $pagination, 'models' => $models, 'filterFields' => $filterFields, 'campaigns' => $campaigns, 'templates' => $templates, 'flags' => $flags));
}
开发者ID:,项目名称:,代码行数:33,代码来源:
示例14: markProcessedCampaignsAsCompleted
/**
* @param null $pageSize | int $pageSize
* @return bool
*/
public static function markProcessedCampaignsAsCompleted($pageSize = null)
{
if ($pageSize != null) {
$resolvedPageSize = $pageSize + 1;
} else {
$resolvedPageSize = $pageSize;
}
$processingCampaigns = Campaign::getByStatus(Campaign::STATUS_PROCESSING, $resolvedPageSize);
$campaignsProcessed = 0;
foreach ($processingCampaigns as $processingCampaign) {
if ($campaignsProcessed < $pageSize || $pageSize == null) {
if (static::areAllCampaignItemsProcessed($processingCampaign->id)) {
$processingCampaign->status = Campaign::STATUS_COMPLETED;
if (!$processingCampaign->save()) {
return false;
}
}
$campaignsProcessed++;
} else {
Yii::app()->jobQueue->add('CampaignMarkCompleted', 5);
break;
}
}
return true;
}
开发者ID:maruthisivaprasad,项目名称:zurmo,代码行数:29,代码来源:CampaignsUtil.php
示例15: newretentionAction
function newretentionAction()
{
$clearArray = array('campaign_id', 'aff_id');
$this->filter($clearArray);
if (!isset($this->params['dates_r'])) {
$dataFrom = mktime(0, 0, 0, date("m") - 1, date("d"), date("Y"));
$fromDate = date("d.m.Y", $dataFrom);
$today = date("d.m.Y");
$this->params['dates_r'] = $fromDate . '-' . $today;
}
if (!isset($this->params['initial_dates'])) {
$fromDate = date("d.m.Y", time() - 777600);
$today = date("d.m.Y");
$this->params['initial_dates'] = $fromDate . '-' . $today;
}
if (!isset($this->params['billing_cycle'])) {
$this->params['billing_cycle'] = 1;
}
$pagination = new Pagination(array('action' => $this->action, 'controller' => $this->controller, 'params' => $this->params));
$models = AFActiveDataProvider::models('Retention', $this->params, $pagination);
$report = $models->getForGraph();
$filterFields = $models->getoutFilterFields($clearArray, array('dates_r', 'initial_dates'));
$campaigns = Campaign::model()->cache()->findAllInArray();
$affiliates = Affiliate::model()->cache()->findAllInArray();
Assets::css('jquery-ui');
Assets::js('//code.jquery.com/ui/1.10.3/jquery-ui.js');
Assets::js('dateRange/jquery.daterange');
Assets::js('//www.google.com/jsapi');
//<script type="text/javascript" src="https://www.google.com/jsapi"></script>
$this->addToPageTitle(__('sales_by_retention_chart'));
$this->render('newretention', array('report' => $report, 'campaigns' => $campaigns, 'affiliates' => $affiliates, 'filterFields' => $filterFields));
}
开发者ID:,项目名称:,代码行数:32,代码来源:
示例16: init
public function init()
{
//'itemTable'=>'AuthItem',
//'itemChildTable'=>'AuthItemChild',
$this->assignmentTable = Campaign::getId() . '_AuthAssignment';
parent::init();
}
开发者ID:akoch-ov,项目名称:dipstart-development,代码行数:7,代码来源:RDbAuthManager.php
示例17: init
public function init()
{
// --- campaign
$c_id = Campaign::getId();
if ($c_id) {
$folder = '/uploads/c' . $c_id . '/parts/';
} else {
$folder = '/uploads/additions/';
}
// ---
$this->arrDataProvider = new CArrayDataProvider(ZakazParts::model()->with('files')->findAllByAttributes(['proj_id' => $this->projectId]));
if (!file_exists(Yii::getPathOfAlias('webroot') . $folder)) {
mkdir(Yii::getPathOfAlias('webroot') . $folder, 0777, true);
}
if (!file_exists(Yii::getPathOfAlias('webroot') . $folder . 'temp/')) {
mkdir(Yii::getPathOfAlias('webroot') . $folder . 'temp/', 0777);
}
if (!User::model()->isCustomer()) {
foreach (array_diff(scandir(Yii::getPathOfAlias('webroot') . $folder . 'temp/'), array('..', '.')) as $k => $v) {
$temps[array_reverse(str_getcsv(pathinfo($v, PATHINFO_FILENAME), '_'))[0]][$k] = array('id' => 0, 'part_id' => array_reverse(str_getcsv(pathinfo($v, PATHINFO_FILENAME), '_'))[0], 'orig_name' => implode('_', array_slice(str_getcsv(pathinfo($v, PATHINFO_FILENAME), '_'), 0, -1)) . '.' . pathinfo($v, PATHINFO_EXTENSION), 'file_name' => Yii::app()->baseUrl . $folder . 'temp/' . $v, 'comment' => 0, 'for_approved' => 'Must approved');
}
}
$tempdata = $this->arrDataProvider->getData();
foreach ($tempdata as $k => $v) {
if (isset($tempdata[$k]->files)) {
foreach ($tempdata[$k]->files as $fk => $fv) {
$tempdata[$k]->files[$fk]->file_name = Yii::app()->baseUrl . $folder . $fv->part_id . '/' . $fv->file_name;
}
}
if (isset($temps[$v->id])) {
$tempdata[$k]->files = array_merge($v->files, $temps[$v->id]);
}
}
$this->arrDataProvider->setData($tempdata);
}
开发者ID:rahmanjis,项目名称:dipstart-development,代码行数:35,代码来源:ZakazPartWidget.php
示例18: getCampaignNumber
public function getCampaignNumber()
{
$name = Yii::app()->user->guestName;
if (strpos($name, 'uest') == 0) {
return false;
}
// только для гостя
if (isset($_REQUEST['campaignId'])) {
$campaignId = (int) $_REQUEST['campaignId'];
$campaign = Campaign::model()->findByPk($campaignId);
$orderId = 0;
if (isset($_REQUEST['orderId'])) {
$orderId = (int) $_REQUEST['orderId'];
}
if (!$orderId) {
return $campaign_id;
}
$order = Zakaz::model()->find('id=:id', array(':id' => $orderId));
if ($campaign) {
$domains = explode(',', $campaign->domains);
$domain = $domains[0];
$_SERVER['SERVER_NAME'] = $domain;
return true;
}
}
$campaigns = Campaign::model()->findAll();
foreach ($campaigns as $campaign) {
$domains = explode(',', $campaign->domains);
$domain = $domains[0];
$_SERVER['SERVER_NAME'] = $domain;
if ($this->getCampaignNumber()) {
return true;
}
}
}
开发者ID:keltstr,项目名称:dipstart-development,代码行数:35,代码来源:Catalog.php
示例19: showIndex
public function showIndex()
{
$campaigns = Campaign::all();
$this->layout->content = View::make('public.home.index');
$this->layout->content->campaigns = $campaigns;
$this->layout->content_title = Lang::get('campaigns.list');
}
开发者ID:ddcint,项目名称:benefund,代码行数:7,代码来源:HomeController.php
示例20: makeAll
public function makeAll(&$demoDataHelper)
{
assert('$demoDataHelper instanceof DemoDataHelper');
assert('$demoDataHelper->isSetRange("Contact")');
assert('$demoDataHelper->isSetRange("Campaign")');
$items = array();
if ($this->loadMagnitude >= 100) {
foreach (Campaign::getAll() as $campaign) {
foreach ($campaign->marketingList->marketingListMembers as $marketingListMember) {
$item = new CampaignItem();
$item->campaign = $campaign;
$item->contact = $marketingListMember->contact;
$this->populateModel($item);
$saved = $item->unrestrictedSave();
assert('$saved');
$items[] = $item->id;
}
}
} else {
for ($i = 0; $i < $this->resolveQuantityToLoad(); $i++) {
$item = new CampaignItem();
$item->campaign = $demoDataHelper->getRandomByModelName('Campaign');
$item->contact = $demoDataHelper->getRandomByModelName('Contact');
$this->populateModel($item);
$saved = $item->unrestrictedSave();
assert('$saved');
$items[] = $item->id;
}
}
$demoDataHelper->setRangeByModelName('CampaignItem', $items[0], $items[count($items) - 1]);
}
开发者ID:youprofit,项目名称:Zurmo,代码行数:31,代码来源:CampaignItemsDemoDataMaker.php
注:本文中的Campaign类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论