You are here

class HackedProjectConverter in Hacked! 8.2

Parameter converter for upcasting entity ids to full objects.

Hierarchy

Expanded class hierarchy of HackedProjectConverter

1 string reference to 'HackedProjectConverter'
hacked.services.yml in ./hacked.services.yml
hacked.services.yml
1 service uses HackedProjectConverter
paramconverter.hacked_project in ./hacked.services.yml
Drupal\hacked\ParamConverter\HackedProjectConverter

File

src/ParamConverter/HackedProjectConverter.php, line 12

Namespace

Drupal\hacked\ParamConverter
View source
class HackedProjectConverter implements ParamConverterInterface {

  /**
   * {@inheritdoc}
   */
  public function convert($value, $definition, $name, array $defaults) {
    return new hackedProject($value);
  }

  /**
   * {@inheritdoc}
   */
  public function applies($definition, $name, Route $route) {
    return !empty($definition['type']) && $definition['type'] === 'hacked_project';
  }

}

Members

Namesort descending Modifiers Type Description Overrides
HackedProjectConverter::applies public function Determines if the converter applies to a specific route and variable. Overrides ParamConverterInterface::applies
HackedProjectConverter::convert public function Converts path variables to their corresponding objects. Overrides ParamConverterInterface::convert