public function findComment($commentOrId)
    {
        if ($commentOrId instanceof CommentInterface) {
            $commentOrId = $commentOrId->getId();
        }
        
        $application = $this->findOneBy(array('comments.id' => $commentOrId));
        /* @var \Applications\Entity\Comment $comment */
        foreach ($application->getComments() as $comment) {
            if ($comment->getId() == $commentOrId) {
                return $comment;
            }
        }
        return null;
    }
public function findComment($commentOrId)
    {
        if ($commentOrId instanceof CommentInterface) {
            $commentOrId = $commentOrId->getId();
        }
        
        $application = $this->findOneBy(array('comments.id' => $commentOrId));
        /* @var \Applications\Entity\Comment $comment */
        foreach ($application->getComments() as $comment) {
            if ($comment->getId() == $commentOrId) {
                return $comment;
            }
        }
        return null;
    }
public function findComment ( $ commentOrId ) { if ( $ commentOrId instanceof CommentInterface ) { $ commentOrId = $ commentOrId -> getId ( ) ; } $ application = $ this -> findOneBy ( array ( 'comments.id' => $ commentOrId ) ) ; /* @var \Applications\Entity\Comment $comment */ foreach ( $ application -> getComments ( ) as $ comment ) { if ( $ comment -> getId ( ) == $ commentOrId ) { return $ comment ; } } return null ; }
Get comments of an applications

@param $commentOrId
@internal param \Application\Entity\Comment $comment | Id
@return \Applications\Entity\Comment|NULL
Get comments of an applications