Get comment ArrayDataProvider

@param CommentModel $commentClass

@return ArrayDataProvider
163233
protected function getCommentDataProvider($commentClass)
    {
        $dataProvider = new ArrayDataProvider($this->dataProviderConfig);
        if (!isset($this->dataProviderConfig['allModels'])) {
            $dataProvider->allModels = $commentClass::getTree($this->entity, $this->entityId, $this->maxLevel);
        }

        return $dataProvider;
    }
660185
public function comments()
    {
        if (!class_exists(\Modules\Blog\Entities\Comment::class, false)) {
            throw new \Exception('in order to use User::comments() you have to install the \'vain-blog\' module');
        }

        return $this->hasMany(\Modules\Blog\Entities\Comment::class);
    }
524074
protected function readModelsData(string $modelClass, int $limit = null): array
    {
        return $this->readTableData($this->getModelSchemas()->getTable($modelClass), $limit);
    }
981539
public static function classfile($class, $comment = false)
	{
		$ref    = new \ReflectionClass($class);
		$start  = $ref->getStartLine();
		$end    = $ref->getEndLine();
		$text   = file_get_contents($ref->getFileName());
		$text   = self::lines($text, $start, $end);
		if ($comment)
		{
			$text = preg_replace('/^\s+\*/m', ' *', $ref->getDocComment()) . PHP_EOL . $text;
		}
		return self::output($text, 'php');
	}
696664
public function getAnnotationsFromPropertyOrClass($annotation_class)
	{
		$annotations = $this->getAnnotations($annotation_class);

		if ( !$annotations ) {
			$annotations = $this->annotationManager->getClassAnnotations($this->getDataType(), $annotation_class);
		}

		return $annotations;
	}
202190
public function findByParentId($commentId)
    {
        $args = array(
            'parent' => $commentId
        );
        $comments = get_comments($args);
        // Convert and return the comments
        return $this->convertAndReturn($comments);
    }
1050889
public function save_comment_track_changed_fields( $data, $comment, $commentarr ) {

		$no_conflict = pods_no_conflict_check( 'user' );

		if ( ! $no_conflict && ! empty( $comment['comment_type'] ) && ! empty( $comment['comment_ID'] ) ) {
			$pod = $comment['comment_type'];
			$id  = $comment['comment_ID'];

			PodsAPI::handle_changed_fields( $pod, $id, 'reset' );
		}

		return $data;

	}
1367032
protected function getClassMetadata(string $resourceClass): ClassMetadata
    {
        return $this
            ->getManagerRegistry()
            ->getManagerForClass($resourceClass)
            ->getClassMetadata($resourceClass);
    }
758009
public function getComment(int $commentId)
    {
        if ( ! $this->validateId($commentId)) {
            return false;
        }

        $result = $this->get('comments/' . $commentId);

        if (200 === $result->getStatusCode()) {
            return json_decode($result->getBody()->getContents());
        }

        return false;
    }
532850
public function commentLine($commentData)
    {
        $command = new Command\Form\CommentLineCommand($commentData);
        $this->getComposite()->addCommand($command);
        return $this;
    }
124540
public function transform(CommentModelContract $item): array
    {
        return [
            'checkbox' => view('admin.module.comments::back.partials.datatables.checkbox', [
                'id' => $item->id,
            ])->render(),
            'id' => (int) $item->id,
            'read' => view('admin.module.comments::back.partials.datatables.read', [
                'is_read' => $item->is_read,
            ])->render(),
            'active' => view('admin.module.comments::back.partials.datatables.active', [
                'id' => $item->id,
                'is_active' => $item->is_active,
            ])->render(),
            'name' => $item->name,
            'email' => $item->email,
            'message' => $item->message,
            'created_at' => (string) $item->created_at,
            'material' => view('admin.module.comments::back.partials.datatables.material', [
                'item' => $item->commentable,
            ])->render(),
            'actions' => view('admin.module.comments::back.partials.datatables.actions', [
                'id' => $item->id,
            ])->render(),
        ];
    }
365566
private function getDoctrineMetadata($entityClass)
    {
        if (!isset($this->doctrineMetadata[$entityClass])) {
            try {
                $this->doctrineMetadata[$entityClass] = $this->em->getClassMetadata($entityClass);
            } catch (MappingException $ex) {
                throw new FiltererException(sprintf('Unable to get Doctrine metadata for class "%s".', $entityClass));
            }
        }

        return $this->doctrineMetadata[$entityClass];
    }
142334
function class_export( $classname, array $commentData = array() ){
		echo 
		"/**\n * Auto-generated file containing class $classname";
		foreach( $commentData as $tag => $value ){
			echo "\n * @$tag $value";
		}
		echo 
		"\n */\n",
		"\n",
		"import('PLUG.parsing.Lex');\n",
		"\n";
		// hard-define integer symbols
		// excluding re-definitions or existing symbols
		ksort( $this->names );
		foreach( $this->names as $i => $c ){
			if( ! is_int($i) ){
				continue;
			}
			if( isset($this->redefinitions[$i]) ){
				//echo "// redefinition: $c = $i \n";
			}
			else {
				echo "define( ",var_export($c,1),", $i );\n";
			}
		}
		// define subclass with overloaded members
		$i = var_export( $this->i, 1 );
		echo 
		"\n",
		"/**\n * Auto-generated Lex subclass";
		// unset page level doc block tags we don't want against the class
		unset (
			$commentData['author'], $commentData['version']
		);
		foreach( $commentData as $tag => $value ){
			echo "\n * @$tag $value";
		}
		echo 
		"\n */\n",
		"class $classname extends Lex {\n",
		"\n",
		// overload $i
		"/** @var int */\n",
		"protected \$i = $i;\n",
		"\n",
		// overload names, parent class's $names array will not need to be consulted
		"/** @var array */\n",
		"protected \$names = ",var_export( $this->names, 1 ),";\n",
		// overload literals, parent class's $literals array will not need to be consulted
		"/** @var array */\n",
		"protected \$literals = ",var_export( $this->literals, 1 ),";\n",
		"\n",
		// end class
		"}\n";
	}
396907
private function getCommentPeopleIDs(TranslatableCommentEntity $comment)
    {
        $result = [];
        $author = $comment->getPostedBy();
        if ($author !== null) {
            $result[] = $author->getUserID();
        }
        foreach ($comment->getChildComments() as $childComment) {
            $result = array_merge($result, $this->getCommentPeopleIDs($childComment));
        }

        return $result;
    }
1294815
public function getNumComments()
    {
        $count = (new CommentManager())
            ->filter("article = %i", array($this->getId()))
            ->filter("active = 1")
            ->filter("spam = 0 ");

        $count = $count->values();

        $num = 0;

        if ($count) {
            foreach ($count as $item) {
                if ($item->isAccessible()) {
                    $num++;
                }
            }
        }

        return $num;
    }
118080
protected function getComment() {
		$comment_body = elgg_view('output/longtext', array(
			'value' => $this->comment->description,
		));
//		if (elgg_view_exists('output/linkify')) {
//			$comment_body = elgg_view('output/linkify', array(
//				'value' => $comment_body
//			));
//		}
		$comment_body .= elgg_view('output/attached', array(
			'entity' => $this->comment,
		));

		$attachments = $this->comment->getAttachments(array('limit' => 0));
		if ($attachments && count($attachments)) {
			$attachments = array_map(__NAMESPACE__ . '\\get_linked_entity_name', $attachments);
			$attachments_text = implode(', ', array_filter($attachments));
			if ($attachments_text) {
				$comment_body .= elgg_echo('interactions:attachments:labelled', array($attachments_text));
			}
		}

		return strip_tags($comment_body, '<p><strong><em><span><ul><li><ol><blockquote><img><a>');
	}
1169262
protected function registerCommentProvider()
    {
        $this->app->bindShared('commentprovider', function ($app) {
            $model = $app['config']['graham-campbell/cms-core::comment'];
            $comment = new $model();

            return new Providers\CommentProvider($comment);
        });
    }