本文整理匯總了PHP中comments::make_url_identifier方法的典型用法代碼示例。如果您正苦於以下問題:PHP comments::make_url_identifier方法的具體用法?PHP comments::make_url_identifier怎麽用?PHP comments::make_url_identifier使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類comments
的用法示例。
在下文中一共展示了comments::make_url_identifier方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: make_a_comment_to
public static function make_a_comment_to(ORM $object, $insertion_user, $title, $content, $moderated_state = 'DEFAULT', Comment_Model $in_reply_to = NULL, $url_identifier = '')
{
$comment_to_insert = ORM::factory('comment');
$comment_to_insert->commented_object = $object;
$comment_to_insert->insertion_user_id = $insertion_user->id;
Workshop::factory()->add_as_author_of($insertion_user, $object);
$comment_to_insert->title = $title;
$comment_to_insert->content = $content;
$comment_to_insert->moderated_state = $moderated_state;
if ($in_reply_to != NULL) {
$comment_to_insert->in_reply_to_id = $in_reply_to->id;
}
if ($url_identifier == '') {
$url_identifier = comments::make_url_identifier($comment_to_insert);
}
$comment_to_insert->url_identifier = url_identifier::get_next_available_url_identifier($comment_to_insert, $url_identifier);
$comment_to_insert->save();
}