'2015-02-01 00:00:00', 'to' => array('alice@example.org'), 'subject' => '/Hello, Alice.*via subject/', ), ), ); $cs[] = array( '2015-02-01 00:00:00', 'addAliceDues addBobDonation scheduleForAny startOnTime useHelloFirstName', array( array( 'time' => '2015-02-01 00:00:00', 'to' => array('alice@example.org'), 'subject' => '/Hello, Alice.*via subject/', ), array( 'time' => '2015-02-01 00:00:00', 'to' => array('bob@example.org'), 'subject' => '/Hello, Bob.*via subject/', ), ), ); $cs[] = array( '2015-02-02 00:00:00', 'addAliceDues addBobDonation scheduleForDonation startWeekBefore repeatTwoWeeksAfter useHelloFirstName', array( array( 'time' => '2015-01-26 00:00:00', 'to' => array('bob@example.org'), 'subject' => '/Hello, Bob.*via subject/', ), array( 'time' => '2015-02-02 00:00:00', 'to' => array('bob@example.org'), 'subject' => '/Hello, Bob.*via subject/', ), array( 'time' => '2015-02-09 00:00:00', 'to' => array('bob@example.org'), 'subject' => '/Hello, Bob.*via subject/', ), array( 'time' => '2015-02-16 00:00:00', 'to' => array('bob@example.org'), 'subject' => '/Hello, Bob.*via subject/', ), ), ); $cs[] = array( '2015-02-03 00:00:00', 'addAliceDues addBobDonation scheduleForSoftCreditor startWeekAfter useHelloFirstName', array( array( 'time' => '2015-02-10 00:00:00', 'to' => array('carol@example.org'), 'subject' => '/Hello, Carol.*via subject/', ), ), ); return $cs; } public function addAliceDues() { $this->callAPISuccess('Contribution', 'create', array( 'contact_id' => $this->contacts['alice']['id'], 'receive_date' => date('Ymd', strtotime($this->targetDate)), 'total_amount' => '100', 'financial_type_id' => 1, 'non_deductible_amount' => '10', 'fee_amount' => '5', 'net_amount' => '95', 'source' => 'SSF', 'contribution_status_id' => 1, 'soft_credit' => array( '1' => array( 'contact_id' => $this->contacts['carol']['id'], 'amount' => 50, 'soft_credit_type_id' => 3, ), ), )); } public function addBobDonation() { $this->callAPISuccess('Contribution', 'create', array( 'contact_id' => $this->contacts['bob']['id'], 'receive_date' => date('Ymd', strtotime($this->targetDate)), 'total_amount' => '150', 'financial_type_id' => 2, 'non_deductible_amount' => '10', 'fee_amount' => '5', 'net_amount' => '145', 'source' => 'SSF', 'contribution_status_id' => 2, )); } public function scheduleForDues() { $this->schedule->mapping_id = CRM_Contribute_ActionMapping_ByType::MAPPING_ID; $this->schedule->start_action_date = 'receive_date'; $this->schedule->entity_value = CRM_Utils_Array::implodePadded(array(1)); $this->schedule->entity_status = CRM_Utils_Array::implodePadded(array(1)); } public function scheduleForDonation() { $this->schedule->mapping_id = CRM_Contribute_ActionMapping_ByType::MAPPING_ID; $this->schedule->start_action_date = 'receive_date'; $this->schedule->entity_value = CRM_Utils_Array::implodePadded(array(2)); $this->schedule->entity_status = CRM_Utils_Array::implodePadded(NULL); } public function scheduleForAny() { $this->schedule->mapping_id = CRM_Contribute_ActionMapping_ByType::MAPPING_ID; $this->schedule->start_action_date = 'receive_date'; $this->schedule->entity_value = CRM_Utils_Array::implodePadded(NULL); $this->schedule->entity_status = CRM_Utils_Array::implodePadded(NULL); } public function scheduleForSoftCreditor() { $this->schedule->mapping_id = CRM_Contribute_ActionMapping_ByType::MAPPING_ID; $this->schedule->start_action_date = 'receive_date'; $this->schedule->entity_value = CRM_Utils_Array::implodePadded(NULL); $this->schedule->entity_status = CRM_Utils_Array::implodePadded(NULL); $this->schedule->limit_to = 1; $this->schedule->recipient = 'soft_credit_type'; $this->schedule->recipient_listing = CRM_Utils_Array::implodePadded(array(3)); } }