本文整理汇总了PHP中CRM_Mailing_Event_BAO_Queue::find方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Mailing_Event_BAO_Queue::find方法的具体用法?PHP CRM_Mailing_Event_BAO_Queue::find怎么用?PHP CRM_Mailing_Event_BAO_Queue::find使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Mailing_Event_BAO_Queue
的用法示例。
在下文中一共展示了CRM_Mailing_Event_BAO_Queue::find方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: open
/**
* Register an open event.
*
* @param int $queue_id
* The Queue Event ID of the recipient.
*/
public static function open($queue_id)
{
// First make sure there's a matching queue event.
$success = FALSE;
$q = new CRM_Mailing_Event_BAO_Queue();
$q->id = $queue_id;
if ($q->find(TRUE)) {
$oe = new CRM_Mailing_Event_BAO_Opened();
$oe->event_queue_id = $queue_id;
$oe->time_stamp = date('YmdHis');
$oe->save();
$success = TRUE;
}
return $success;
}
示例2: open
/**
* Register an open event
*
* @param int $queue_id The Queue Event ID of the recipient
* @return void
* @access public
* @static
*/
public static function open($queue_id)
{
/* First make sure there's a matching queue event */
require_once 'CRM/Mailing/Event/BAO/Queue.php';
$success = false;
$q = new CRM_Mailing_Event_BAO_Queue();
$q->id = $queue_id;
if ($q->find(true)) {
$oe = new CRM_Mailing_Event_BAO_Opened();
$oe->event_queue_id = $queue_id;
$oe->time_stamp = date('YmdHis');
$oe->save();
$success = true;
}
return $success;
}
示例3: date
/**
* Create a new delivery event
* @param array $params Associative array of delivery event values
* @return void
* @access public
* @static
*/
public static function &create(&$params)
{
$q =& CRM_Mailing_Event_BAO_Queue::verify($params['job_id'], $params['event_queue_id'], $params['hash']);
if (!$q) {
return null;
}
$q->free();
$delivered =& new CRM_Mailing_Event_BAO_Delivered();
$delivered->time_stamp = date('YmdHis');
$delivered->copyValues($params);
$delivered->save();
$queue = new CRM_Mailing_Event_BAO_Queue();
$queue->id = $params['event_queue_id'];
$queue->find(true);
while ($queue->fetch()) {
$email =& new CRM_Core_BAO_Email();
$email->id = $queue->email_id;
$email->hold_date = '';
$email->reset_date = date('YmdHis');
$email->save();
}
return $delivered;
}
示例4:
/**
* Verify that a queue event exists with the specified id/job id/hash.
*
* @param int $job_id
* The job ID of the event to find.
* @param int $queue_id
* The Queue Event ID to find.
* @param string $hash
* The hash to validate against.
*
* @return object|null
* The queue event if verified, or null
*/
public static function &verify($job_id, $queue_id, $hash)
{
$success = NULL;
$q = new CRM_Mailing_Event_BAO_Queue();
if (!empty($job_id) && !empty($queue_id) && !empty($hash)) {
$q->id = $queue_id;
$q->job_id = $job_id;
$q->hash = $hash;
if ($q->find(TRUE)) {
$success = $q;
}
}
return $success;
}
示例5: _checkActivity
/**
* Helper function for Check contents in Activity.
* @param $atype
* @param $contactName
*
* return string
*/
public function _checkActivity($atype, $contactName, $subject, $withContact, $isHeader = TRUE, $mailingId = NULL)
{
$this->openCiviPage('activity/search', 'reset=1', '_qf_Search_refresh');
$this->select('activity_type_id', "label={$atype}");
$this->type('sort_name', $contactName);
$this->clickLink('_qf_Search_refresh', 'Search');
// View your Activity
$this->clickLink("xpath=id('Search')/div[3]/div/div[2]/table/tbody/tr[2]/td[9]/span/a[text()='View']", "_qf_Activity_cancel", FALSE);
$this->assertTrue($this->isTextPresent($atype));
$expected = array(4 => $subject, 8 => 'Completed', 2 => $withContact, 10 => 'Urgent');
foreach ($expected as $label => $value) {
$this->verifyText("xpath=id('Activity')/div[2]/table[1]/tbody/tr[{$label}]/td[2]", preg_quote($value));
}
if (!$isHeader) {
return FALSE;
}
$header = $this->urlArg('id', $this->getAttribute("xpath=id('Search')/div[3]/div/div[2]/table/tbody/tr[2]/td[9]/span/a[text()='View']@href"));
if ($mailingId) {
$cid = $this->urlArg('cid', $this->getAttribute("xpath=id('Search')/div[3]/div/div[2]/table/tbody/tr[2]/td[9]/span/a[text()='View']@href"));
$queueId = CRM_Core_DAO::singleValueQuery("SELECT ce.id FROM `civicrm_mailing_event_queue` ce\nINNER JOIN civicrm_mailing_job mj ON mj.id = ce.job_id and ce.contact_id = {$cid} AND mj.mailing_id = {$mailingId}");
} else {
$queueId = CRM_Core_DAO::singleValueQuery('SELECT mailing_queue_id FROM civicrm_mandrill_activity WHERE activity_id = ' . $header);
}
if ($queueId) {
$queue = new CRM_Mailing_Event_BAO_Queue();
$queue->id = $queueId;
if ($queue->find(TRUE)) {
$header = implode(CRM_Core_Config::singleton()->verpSeparator, array($header, 'm', $queue->job_id, $queue->id, $queue->hash));
}
}
return $header;
}