public function get_favourite(string $component, string $itemtype, int $itemid, \context $context) {
        try {
            return $this->repo->find_favourite(
                $this->userid,
                $component,
                $itemtype,
                $itemid,
                $context->id
            );
        } catch (\dml_missing_record_exception $e) {
            return null;
        }
    }
public function get_favourite(string $component, string $itemtype, int $itemid, \context $context) {
        try {
            return $this->repo->find_favourite(
                $this->userid,
                $component,
                $itemtype,
                $itemid,
                $context->id
            );
        } catch (\dml_missing_record_exception $e) {
            return null;
        }
    }
public function get_favourite ( string $ component , string $ itemtype , int $ itemid , \ context $ context ) { try { return $ this -> repo -> find_favourite ( $ this -> userid , $ component , $ itemtype , $ itemid , $ context -> id ) ; } catch ( \ dml_missing_record_exception $ e ) { return null ; } }
Get the favourite.

@param string $component the frankenstyle component name.
@param string $itemtype the type of the favourited item.
@param int $itemid the id of the item which was favourited (not the favourite's id).
@param \context $context the context of the item which was favourited.
@return favourite|null
Get the favourite .