45 lines
901 B
PHP
45 lines
901 B
PHP
<?php
|
|
|
|
// No direct access.
|
|
defined('_JEXEC') or die;
|
|
|
|
class CommonClubsControllerMappingRef extends AbstractCommonClubsControllerMapping
|
|
{
|
|
|
|
/**
|
|
* @var AbstractCommonClubsModelFactory
|
|
*/
|
|
protected $factory;
|
|
|
|
/**
|
|
* @param string $name
|
|
* @param AbstractCommonClubsModelFactory $factory
|
|
* @param boolean $required
|
|
*/
|
|
public function __construct($name, $factory, $required = true)
|
|
{
|
|
parent::__construct($name, $required);
|
|
$this->factory = $factory;
|
|
}
|
|
|
|
public function getFilteredValue($input, $name)
|
|
{
|
|
return $input->getInt($name);
|
|
}
|
|
|
|
public function rawValueValid($value)
|
|
{
|
|
try
|
|
{
|
|
$this->factory->loadById((int) $value);
|
|
}
|
|
catch(ElementNotFoundException $e)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
}
|