本文整理匯總了PHP中blogPostModel::ping方法的典型用法代碼示例。如果您正苦於以下問題:PHP blogPostModel::ping方法的具體用法?PHP blogPostModel::ping怎麽用?PHP blogPostModel::ping使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類blogPostModel
的用法示例。
在下文中一共展示了blogPostModel::ping方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: insertPost
protected function insertPost($post)
{
static $post_model;
if (!$post_model) {
$post_model = new blogPostModel();
}
if (empty($post['contact_id'])) {
$post['contact_id'] = $this->settings['contact'];
}
$method = __METHOD__;
$this->log(var_export(compact('method', 'post'), true));
$post['blog_id'] = $this->settings['blog'];
$post['blog_status'] = $this->settings['blog_status'];
$post['text'] = $this->userReplace($post['text']);
$post_model->ping();
switch ($field = $this->settings['mode']) {
case 'title':
if ($p = $post_model->getByField(array($field => $post[$field], 'blog_id' => $post['blog_id']))) {
$this->log("Post with timestamp [{$post['timestamp']}] skipped because there was a duplicate (id={$p['id']})", self::LOG_NOTICE);
$this->log("Post raw data " . var_export($post, true), self::LOG_DEBUG);
return false;
}
break;
}
if ($post['blog_status'] == blogBlogModel::STATUS_PUBLIC) {
$post['url'] = $post_model->genUniqueUrl(empty($post['url']) ? $post['title'] : $post['url']);
} elseif (!empty($post['url'])) {
$post['url'] = $post_model->genUniqueUrl($post['url']);
} else {
$post['url'] = '';
}
$post['id'] = $post_model->updateItem(null, $post);
return $post;
}