本文整理汇总了PHP中core\Model::edit方法的典型用法代码示例。如果您正苦于以下问题:PHP Model::edit方法的具体用法?PHP Model::edit怎么用?PHP Model::edit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类core\Model
的用法示例。
在下文中一共展示了Model::edit方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: edit
public function edit($id, $fields)
{
$fields['full_url'] = $this->make_full_url($fields['id_parent'], $fields['url']);
$res = parent::edit($id, $fields);
if ($res) {
$this->updateChildrenUrl($id);
}
return $res;
}
示例2: edit
public function edit($id, $fields, $privs)
{
$res = parent::edit($id, $fields);
if ($res != false) {
$this->db->delete('roles_privs', 'id_role=:id_role', ['id_role' => $id]);
if (count($privs) > 0) {
foreach ($privs as $key => $id_priv) {
$this->db->insert('roles_privs', ['id_role' => $id, 'id_priv' => $id_priv]);
}
}
}
return $res;
}
示例3: edit
public function edit($id, $fields, $file)
{
if ($file['name'] != '') {
$id_image = Image::app()->add($file);
if ($id_image === false) {
return false;
} else {
$fields['id_image'] = $id_image;
}
}
$res = parent::edit($id, $fields);
if ($res == false && $id_image != null) {
Image::app()->delete($id_image);
}
return $res;
}
示例4: edit
public function edit($id, $fields, $tags, $file)
{
if ($file['name'] != '') {
$id_image = Image::app()->add($file);
if ($id_image === false) {
return false;
} else {
$fields['id_image'] = $id_image;
}
}
$res = parent::edit($id, $fields);
if ($res != false) {
$this->db->delete('posts_tags', 'id_post=:id_post', ['id_post' => $id]);
if (count($tags) > 0) {
foreach ($tags as $key => $tag) {
$this->db->insert('posts_tags', ['id_post' => $id, 'id_tag' => $tag]);
}
}
} elseif ($res == false && $id_image != null) {
Image::app()->delete($id_image);
}
return $res;
}