plugin/blog/Manager/BlogManager.php
public function getBlogByIdOrUuid($id)
    {
        if (preg_match('/^\d+$/', $id)) {
            $blog = $this->repo->findOneBy([
                'id' => $id,
            ]);
        } else {
            $blog = $this->repo->findOneBy([
                'uuid' => $id,
            ]);
        }

        return $blog;
    }
public function getBlogByIdOrUuid($id)
    {
        if (preg_match('/^\d+$/', $id)) {
            $blog = $this->repo->findOneBy([
                'id' => $id,
            ]);
        } else {
            $blog = $this->repo->findOneBy([
                'uuid' => $id,
            ]);
        }

        return $blog;
    }
public function getBlogByIdOrUuid ( $ id ) { if ( preg_match ( '/^\d+$/' , $ id ) ) { $ blog = $ this -> repo -> findOneBy ( [ 'id' => $ id , ] ) ; } else { $ blog = $ this -> repo -> findOneBy ( [ 'uuid' => $ id , ] ) ; } return $ blog ; }
Get blog by its ID or UUID.

@param string $id

@return Blog
Get blog by its ID or UUID .