本文整理汇总了PHP中MY_Model::add方法的典型用法代码示例。如果您正苦于以下问题:PHP MY_Model::add方法的具体用法?PHP MY_Model::add怎么用?PHP MY_Model::add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MY_Model
的用法示例。
在下文中一共展示了MY_Model::add方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: add
public function add($params)
{
$this->load->model('miniant/tenancy_log_model');
$tenancy_id = parent::add($params);
$this->tenancy_log_model->create_tenancy($tenancy_id);
return $tenancy_id;
}
示例2: add
function add($vals)
{
if (!isset($vals['name'])) {
return 1;
}
$titleName = 'chapter_titleName_' . $vals['name'] . '_';
$vals['title_name'] = $titleName . $this->makeUniqueName($titleName);
$textName = 'chapter_textName_' . $vals['name'] . '_';
$vals['text_name'] = $textName . $this->makeUniqueName($textName);
$vals['sort'] = count($this->getAll('page_id', $vals['page_id']));
parent::add($vals);
$this->load->model('MTexts', 'MTexts', TRUE);
$this->MTexts->add(array('name' => $vals['title_name']));
$this->MTexts->add(array('name' => $vals['text_name']));
return 0;
}
示例3: add
public function add($params)
{
$this->load->model('miniant/unit_model');
$params = (array) $params;
$order_type = $this->get_type_string($params['order_type_id']);
$workflow_id = $this->workflow_model->get(array('name' => strtolower($order_type)), true)->id;
if ($params['order_type_id'] == $this->get_type_id('Maintenance') || $params['order_type_id'] == $this->get_type_id('Service')) {
$units = $this->unit_model->get(array('site_address_id' => $params['site_address_id']));
if (!empty($units)) {
$order_id = parent::add($params);
if ($params['order_type_id'] != $this->get_type_id('Installation')) {
foreach ($units as $unit) {
$this->db->insert('miniant_assignments', array('order_id' => $order_id, 'unit_id' => $unit->id, 'workflow_id' => $workflow_id));
}
}
return $order_id;
} else {
return parent::add($params);
}
} else {
return parent::add($params);
}
}
示例4: add
/**
* Crea un nuovo loved (idprofilo, videoid...)
* Precondizione: devono essere impostati gli attributi profile_id e videoid
* @return int idLoved l'identificatoe del loved inserito. 0 Se c'e' qualche errore
*/
public function add() {
$data = $this->popolateData();
$idLoved = parent::add("loved", $data);
return $idLoved;
}
示例5: add
/**
* Before adding, also create an order_technician record, if needed
*/
public function add($params)
{
$params = (array) $params;
if (!empty($params['technician_id'])) {
$this->order_technician_model->add_if_new($params['order_id'], $params['technician_id']);
}
return parent::add($params);
}
示例6: add
function add()
{
parent::add(array('title' => 'tytuł', 'desc' => 'Tresc', 'short_desc' => 'Skrocona tresc'));
}
示例7: add
public function add($fields)
{
$fields = (array) $fields;
if (!empty($fields['order_id'])) {
$order_id = $fields['order_id'];
unset($fields['order_id']);
$unit_id = parent::add($fields);
$this->db->insert('miniant_assignments', array('order_id' => $order_id, 'unit_id' => $unit_id));
if (!empty($fields['tenancy_id'])) {
$this->tenancy_log_model->add_unit($params['tenancy_id'], $unit->id);
}
return $unit_id;
} else {
return parent::add($fields);
}
}