本文整理汇总了PHP中Meeting::createRow方法的典型用法代码示例。如果您正苦于以下问题:PHP Meeting::createRow方法的具体用法?PHP Meeting::createRow怎么用?PHP Meeting::createRow使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Meeting
的用法示例。
在下文中一共展示了Meeting::createRow方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _createPhone
public function _createPhone($form, $id, $cc = false, $registered = false, $visit = false)
{
$eventModel = new Event();
$contactModel = new Contact();
$meetingModel = new Meeting();
$values = $form->getValues();
$eventData = $values;
if ($visit || $registered) {
$eventData['meeting_title'] = $eventData['visit_meeting_title'];
$eventData['money_amount'] = $eventData['visit_money_amount'];
$eventData['responsible_branch'] = Zend_Auth::getInstance()->getIdentity()->id_branch;
$eventData['responsible_adviser'] = Zend_Auth::getInstance()->getIdentity()->id;
$eventData['event_at'] = $eventData['visit_event_at'];
$eventData['meeting_length'] = 0;
$eventData['comment'] = $eventData['visit_comment'];
unset($eventData['visit_meeting_title'], $eventData['visit_event_at'], $eventData['visit_money_amount'], $eventData['visit_meeting_length'], $eventData['visit_comment'], $eventData['visit_classification']);
}
$contact = $contactModel->findOne($id);
$contact->changeGuardian();
$contact->cc_status = $cc ? '{2,1,0}' : '{4,0,0}';
if (!$cc) {
$contact->branch_status = 1;
}
if (!$cc && ($visit || $registered)) {
$contact->is_comeback = false;
}
if ($contact->marketing_status == 1 && $cc) {
$contact->marketing_status = 4;
}
if ($cc) {
$contact->cc_phone_count++;
} else {
$contact->phone_count++;
}
$event = $eventModel->createRow();
$eventData['id_contact'] = $id;
$eventData['created_by'] = Zend_Auth::getInstance()->getIdentity()->id;
$eventData['id_event_type'] = 1;
$eventData['confirmed'] = 0;
$eventData['confirmation_required'] = 0;
$eventData['meeting_registered'] = (int) ($registered || $visit);
$eventData['registrant_branch'] = Zend_Auth::getInstance()->getIdentity()->id_branch;
$eventData['id_branch'] = $eventData['responsible_branch'];
$eventData['contact_type'] = $contact->type;
$eventData['contacts'] = 1;
if (Zend_Auth::getInstance()->getIdentity()->jednostka['type'] == 3) {
$eventData['cc_meeting_title'] = $eventData['meeting_title'];
}
if ($eventData['meeting_title']) {
$meetingTitle = new MeetingTitle();
$eventData['interest_point'] = $meetingTitle->findOne($eventData['meeting_title'])->id_product_type;
} else {
$eventData['interest_point'] = null;
}
if (!$eventData['responsible_adviser']) {
unset($eventData['responsible_adviser']);
}
if ($contact->id_company != null) {
$eventData['id_company'] = $contact->id_company;
}
$meeting = $meetingModel->createRow();
$meetingData = array();
$meetingData['id_contact'] = $id;
if (Zend_Auth::getInstance()->getIdentity()->jednostka['type'] == 3) {
$meetingData['cc_meeting_title'] = $eventData['meeting_title'];
}
$meetingData['meeting_title'] = $eventData['meeting_title'];
$meetingData['interest_point'] = $eventData['interest_point'];
$meetingData['id_branch'] = $eventData['responsible_branch'];
$meetingData['meeting_at'] = $eventData['event_at'];
$meetingData['length'] = 0;
$meetingData['id_meeting_type'] = 1;
$meetingData['confirmed'] = 0;
$meetingData['confirmation_required'] = 0;
$meetingData['registered'] = (int) ($registered || $visit);
$meetingData['contacts'] = 1;
$meetingData['money_amount'] = $eventData['money_amount'];
if (isset($eventData['responsible_adviser'])) {
$meetingData['id_user'] = $eventData['responsible_adviser'];
}
$event->setFromArray($eventData);
try {
$eventModel->getAdapter()->beginTransaction();
$event_id = $event->save();
$meetingData['id_event'] = $event_id;
$meeting->setFromArray($meetingData);
$meeting->save();
if (!$cc) {
$contact->after_meeting_out = 0;
}
$ret = $contact->save();
$eventModel->getAdapter()->commit();
} catch (Exception $e) {
$eventModel->getAdapter()->rollBack();
throw $e;
}
$message['messages']['Contact'][$id] = 'Phone event was created.';
$logger = Zend_Registry::get('logger');
Zend_Registry::set('logger', array_merge($logger, $message));
return $ret;
//.........这里部分代码省略.........