本文整理汇总了PHP中Lead::save方法的典型用法代码示例。如果您正苦于以下问题:PHP Lead::save方法的具体用法?PHP Lead::save怎么用?PHP Lead::save使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Lead
的用法示例。
在下文中一共展示了Lead::save方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createLead
public static function createLead($id = '')
{
$time = mt_rand();
$first_name = 'SugarLeadFirst';
$last_name = 'SugarLeadLast';
$email1 = 'lead@sugar.com';
$lead = new Lead();
$lead->first_name = $first_name . $time;
$lead->last_name = $last_name;
$lead->email1 = 'lead@' . $time . 'sugar.com';
if (!empty($id)) {
$lead->new_with_id = true;
$lead->id = $id;
}
$lead->save();
self::$_createdLeads[] = $lead;
return $lead;
}
示例2: actionCreate
/**
* Creates a new model.
* If creation is successful, the browser will be redirected to the 'view' page.
*/
public function actionCreate()
{
$model = new Lead();
$result = new User();
$res = User::Model()->findallByattributes(array('superuser' => 2));
$leaduser = new LeadUsers();
$prop = Priority::Model()->findall();
$rem = Reminders::Model()->findall();
if (isset($_POST['Lead'])) {
/* $model->reminder_time=$_POST['Lead']['reminder_time'].':'.$_POST['Lead']['sec']; */
$model->status = 1;
$model->min_size = $_POST['Lead']['min_size'];
$model->max_size = $_POST['Lead']['max_size'];
$model->retailer_webiste = $_POST['Lead']['retailer_webiste'];
$model->broker_firstname = $_POST['Lead']['broker_firstname'];
$model->broker_lastname = $_POST['Lead']['broker_lastname'];
$model->broker_territory = $_POST['Lead']['broker_territory'];
$model->broker_company = $_POST['Lead']['broker_company'];
/* $model->broker_phone_no= $_POST['broker_phone_no'];
$model->broker_cell_no= $_POST['broker_cell_no'];
$model->broker_email= $_POST['broker_email']; */
$model->linked_username = $_POST['Lead']['linked_username'];
$model->enquiry_date = $_POST['enquiry_date'];
$model->create_at = date('Y-m-d-h:i:sa');
$model->country = $_POST['country'];
/* $model->reminder_date=$_POST['reminder_date']; */
$model->user_id = Yii::app()->user->id;
$model->attributes = $_POST['Lead'];
/* echo "<pre>"; print_r(array($model->attributes,$_POST)); */
if ($model->save()) {
/* if(isset($_POST['reminder_date'])){
$Last_id = $model->id;
$status = 1;
Yii::app()->db->createCommand("INSERT INTO `tbl_reminders`(`lead_id`,`date`,`time`,`msg`,`status` ) VALUES ('".$Last_id."', '".$_POST['reminder_date']."','".$_POST['Lead']['reminder_time'].":".$_POST['Lead']['sec']."','".$_POST['Lead']['message']."','".$status."')" )->execute(); } */
$this->redirect(array('admin'));
}
}
$this->render('create', array('model' => $model, 'models' => $res, 'props' => $prop));
}
示例3: store
public function store()
{
$v = Validator::make($data = Input::all(), Lead::$rules);
if ($v->fails()) {
return Response::json(array('flash' => 'Something went wrong, try again !'), 500);
} else {
$lead = new Lead();
$user = Sentry::getUser();
$lead->salutation = Input::get('salutation');
$lead->first_name = Input::get('first_name');
$lead->last_name = Input::get('last_name');
$lead->phone = Input::get('phone');
$lead->email = Input::get('email');
$lead->instance = Input::get('instance');
$lead->address = Input::get('address');
$lead->address2 = Input::get('address2');
$lead->description = Input::get('description');
$lead->status_id = Input::get('status_id');
$lead->save();
$lead->users()->attach($user, array('notes' => 'User ini yang mengawali lead ini'));
return Response::json(array('success' => true, 'flash' => 'New lead has been successfully created !'), 200);
}
}
示例4: create_lead
function create_lead($user_name, $password, $first_name, $last_name, $email_address)
{
if (!validate_user($user_name, $password)) {
return 0;
}
//todo make the activity body not be html encoded
$seed_user = new User();
$user_id = $seed_user->retrieve_user_id($user_name);
$lead = new Lead();
if (!$lead->ACLAccess('Save')) {
return -1;
}
$lead->first_name = $first_name;
$lead->last_name = $last_name;
$lead->email1 = $email_address;
$lead->assigned_user_id = $user_id;
$lead->assigned_user_name = $user_name;
return $lead->save();
}
示例5: Project
$lead->assigned_user_name = "seed_max";
}
}
$lead->assigned_user_id = $lead->assigned_user_name . "_id";
}
// If this is a large scale test, switch to the bulk teams 90% of the time.
if ($large_scale_test) {
if (mt_rand(0, 100) < 90) {
$assigned_team = $team_demo_data->get_random_team();
$lead->assigned_user_name = $assigned_team;
} else {
}
}
$lead->primary_address_postalcode = mt_rand(10000, 99999);
$lead->primary_address_country = 'USA';
$lead->save();
}
///
/// SEED DATA FOR PROJECT AND PROJECT TASK
///
// Project: Audit Plan
$project = new Project();
$project->name = 'Create new project plan for audit';
$project->description = 'Annual audit coming up next month.';
$project->assigned_user_id = 1;
$project->estimated_start_date = '2007-11-01';
$project->estimated_end_date = '2007-12-31';
$project->status = 'Draft';
$project->priority = 'medium';
$audit_plan_id = $project->save();
$project_task = new ProjectTask();
示例6: Lead
function converted_lead($leadid, $contactid, $accountid, $opportunityid)
{
$query = "UPDATE leads set converted='1', contact_id={$contactid}, account_id={$accountid}, opportunity_id={$opportunityid} where id={$leadid} and deleted=0";
$this->db->query($query, true, "Error converting lead: ");
//we must move the status out here in order to be able to capture workflow conditions
$leadid = str_replace("'", "", $leadid);
$lead = new Lead();
$lead->retrieve($leadid);
$lead->status = 'Converted';
$lead->save();
}
示例7: testSaveAndConverted_lead
public function testSaveAndConverted_lead()
{
$lead = new Lead();
$lead->first_name = "firstn";
$lead->last_name = "lastnn";
$lead->lead_source = "test";
$result = $lead->save();
//test for record ID to verify that record is saved
$this->assertTrue(isset($lead->id));
$this->assertEquals(36, strlen($lead->id));
$this->assertEquals("New", $lead->status);
//test converted_lead method after saving
/*$lead->converted_lead("'" . $lead->id . "'" , "'1'", "'1'", "'1'");
//retrieve back to test if attributes are updated in db
$lead = $lead->retrieve($lead->id);
$this->assertEquals("Converted", $lead->status);
$this->assertEquals("1", $lead->converted);
$this->assertEquals("1", $lead->contact_id);
$this->assertEquals("1", $lead->account_id);
$this->assertEquals("1", $lead->opportunity_id);
*/
$this->markTestSkipped("converted_lead: Error in query, id's not properly escaped ");
//mark the record as deleted and verify that this record cannot be retrieved anymore.
$lead->mark_deleted($lead->id);
$result = $lead->retrieve($lead->id);
$this->assertEquals(null, $result);
}
示例8: create_lead_from_webform
function create_lead_from_webform($lastname, $email, $phone, $company, $country, $description)
{
global $adb;
$adb->println("Create New Lead from Web Form - Starts");
require_once "modules/Leads/Lead.php";
$focus = new Lead();
$focus->column_fields['lastname'] = $lastname;
$focus->column_fields['email'] = $email;
$focus->column_fields['phone'] = $phone;
$focus->column_fields['company'] = $company;
$focus->column_fields['country'] = $country;
$focus->column_fields['description'] = $description;
$focus->save("Leads");
$focus->retrieve_entity_info($focus->id, "Leads");
$adb->println("Create New Lead from Web Form - Ends");
if ($focus->id != '') {
return 'Thank you for your interest. Information has been successfully added as Lead.';
} else {
return "Lead creation failed. Try again";
}
}