Get content by its id

@param int $id

@return null|ContentInterface
510868
public function getContentById($id)
    {
        return $this->om->getRepository($this->configurationManager->getEntityClass('content'))->find($id);
    }
840056
public function delete($id = null) {
        $this->request->allowMethod(['post', 'delete']);
        $this->CmsContent = TableRegistry::get('CmsContent');
        $cmsContent = $this->CmsContent->get($id);
        if ($this->CmsContent->delete($cmsContent)) {
            $this->Flash->success('The cms content has been deleted.');
        } else {
            $this->Flash->error('The cms content could not be deleted. Please, try again.');
        }
        return $this->redirect(['action' => 'index']);
    }
1142240
public function get($id=NULL) {
  if (!isset($id)) return $this->all();
  $query = new \Peyote\Select('report_types');
  $query->columns('id, value')
        ->where('id', '=', $id);
  return $this->db->fetch($query);
 }
690298
public function get($id)
    {
        $document = $this->getFileCollection()->findOne(['_id' => $id]);
        return empty($document) ? null : $this->createDownload($document);
    }
915184
public function getContentTypeById($id)
    {
        return $this->om->getRepository($this->configurationManager->getEntityClass('content_type'))->find($id);
    }
1213219
public function getAction($id)
    {
        $view = $this->responseGetById(
            $id,
            function($id) {
                return $this->getDoctrine()
                    ->getRepository(self::$entityName)
                    ->find($id);
            }
        );

        return $this->handleView($view);
    }
791594
public function find($id)
    {
        $key = $this->getHash().$id;
        if($this->getFileManager()->has($key)) {
            return $this->loadEntity($key);
        }
        
        return null;
    }
150587
public function getPage($id)
    {
        return isset($this->pages[$id])?$this->pages[$id]:null;
    }
1041619
public static function getByID($id)
    {
        if ($id) {
            $app = Application::getFacadeApplication();
            $em = $app->make(EntityManagerInterface::class);
            $result = $em->find(ThumbnailTypeEntity::class, $id);
        } else {
            $result = null;
        }

        return $result;
    }
1347160
public function get ($id)
		{
			foreach ($this->_data as $category)
				if ($category->id == $id)
					return $category;

			return null;
		}
491693
public function getFileset($id) {
    $filesets = $this->getFilesets();
    if (isset($filesets[$id])) {
      return $filesets[$id];
    }
    $this->logger->warning("Fileset $id not found");

    return NULL;
  }
704344
protected function deleteRelatedContent($id = NULL) {
        $this->CmsContent = TableRegistry::get('CmsContent');
        $content = $this->CmsContent->get($id);
        if (trim($content->content_path) != '')
            $this->_removeFile($content->content_path);
        return $this->CmsContent->delete($content);
    }
1047397
public function get($id)
    {
        return $this->_sendPayload(
            $this->_getService($this->_pageServiceKey)->getActiveTemplateSections($id)
        );
    }
326723
public function getObjectById($id)
    {
        if (isset($this->objects[$id])) {
            return $this->objects[$id];
        } else {
            return null;
        }
    }
571923
public function getQuestion4Id($id)
    {
        $query = $this->createQueryBuilder('p')
            ->select('p')
            ->where('p.id = :id')
            ->setParameter('id', $id)
            ->getQuery();


        return $query->getOneOrNullResult();
    }
254780
public function findOneById($id)
    {
        try {
            return $this->_documentHandler->getById($this->_collectionName, $id);
        } catch (ServerException $e) {
            if ($e->getServerMessage() === 'document not found') {
                return null;
            }
            throw $e;
        }
    }
1131656
public function getById(int $id)
    {
        $result = $this->builder->getById($id);

        if (isset($result[0])) {
            return self::instance($result[0]);
        }

        return null;
    }