You are here

public function InviteParamConverter::convert in Invite 8

Converts reg_code to invite.

Overrides ParamConverterInterface::convert

File

src/ParamConverter/InviteParamConverter.php, line 24

Class

InviteParamConverter
Class InviteParamConverter.

Namespace

Drupal\invite\ParamConverter

Code

public function convert($reg_code, $definition, $name, array $defaults) {
  $invite = \Drupal::entityQuery('invite')
    ->condition('reg_code', $reg_code)
    ->execute();
  return Invite::load(reset($invite));
}