本文整理匯總了PHP中blogPostModel::updateByField方法的典型用法代碼示例。如果您正苦於以下問題:PHP blogPostModel::updateByField方法的具體用法?PHP blogPostModel::updateByField怎麽用?PHP blogPostModel::updateByField使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類blogPostModel
的用法示例。
在下文中一共展示了blogPostModel::updateByField方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: move
static function move($blog_id, $move_blog_id)
{
if ($blog_id != $move_blog_id) {
$post_model = new blogPostModel();
$post_model->updateByField('blog_id', $blog_id, array('blog_id' => $move_blog_id));
$comment_model = new blogCommentModel();
$comment_model->updateByField('blog_id', $blog_id, array('blog_id' => $move_blog_id));
$blog_model = new blogBlogModel();
$blog_model->recalculate(array($blog_id, $move_blog_id));
}
}
示例2: execute
/**
* @param int[] $params Deleted contact_id
* @see waEventHandler::execute()
* @return void
*/
public function execute($params)
{
$contact_model = new waContactModel();
$contacts = $contact_model->getByField('id', $params, true);
$post_model = new blogPostModel();
$comment_model = new blogCommentModel();
foreach ($contacts as $contact) {
$data = array('contact_id' => 0, 'contact_name' => $contact['name']);
$post_model->updateByField('contact_id', $contact['id'], $data);
$data = array('contact_id' => 0, 'name' => $contact['name'], 'auth_provider' => null);
$comment_model->updateByField('contact_id', $contact['id'], $data);
}
}
示例3: execute
/**
* @param int[] $params Deleted contact_id
* @see waEventHandler::execute()
* @return void
*/
public function execute(&$params)
{
$contact_model = new waContactModel();
$contacts = $contact_model->getByField('id', $params, true);
$post_model = new blogPostModel();
$comment_model = new blogCommentModel();
foreach ($contacts as $contact) {
$data = array('contact_id' => 0, 'contact_name' => $contact['name']);
$post_model->updateByField('contact_id', $contact['id'], $data);
$data = array('contact_id' => 0, 'name' => $contact['name'], 'auth_provider' => null);
$comment_model->updateByField('contact_id', $contact['id'], $data);
}
/**
* @event contacts_delete
* @param array[] int $contact_ids array of contact's ID
* @return void
*/
wa()->event(array('blog', 'contacts_delete'), $params);
}