Fenos\Notifynder\Contracts\CategoryDB::find PHP Method

find() public method

Find By Id.
public find ( $categoryId ) : mixed
$categoryId
return mixed
    public function find($categoryId);

Usage Example

Example #1
0
 /**
  * Find a category by id.
  *
  * @param $categoryId
  * @throws CategoryNotFoundException
  * @return mixed
  */
 public function find($categoryId)
 {
     $category = $this->categoryRepo->find($categoryId);
     if (is_null($category)) {
         $error = 'Category Not Found';
         throw new CategoryNotFoundException($error);
     }
     return $category;
 }