getContentService() public method

Get service object to perform operations on Content objects and it's aggregate members.
public getContentService ( ) : eZ\Publish\API\Repository\ContentService
return eZ\Publish\API\Repository\ContentService
 /**
  * Gets ContentType ID based on $contentId.
  *
  * @param mixed $contentId
  *
  * @return int|null
  */
 protected function getContentTypeId($contentId)
 {
     $contentService = $this->repository->getContentService();
     $contentTypeId = null;
     try {
         $contentTypeId = $contentService->loadContentInfo($contentId)->contentTypeId;
     } catch (Exception $e) {
     }
     return $contentTypeId;
 }