Habari\AdminCommentsHandler::comment_access_filter PHP Метод

comment_access_filter() публичный Метод

A helper function for fetch_comments() Filters a list of comments by ACL access
public comment_access_filter ( object $comments, string $access ) : a
$comments object an array of Comment objects
$access string the access type to check for
Результат a filtered array of Comment objects.
    public function comment_access_filter($comments, $access)
    {
        $result = array();
        foreach ($comments as $comment) {
            if (ACL::access_check($comment->get_access(), $access)) {
                $result[] = $comment;
            }
        }
        return $result;
    }