Redaxscript\Router\Parameter::getId PHP Method

getId() public method

get the id parameter
Since: 2.4.0
public getId ( ) : string
return string
    public function getId()
    {
        if ($this->getTable() && $this->getSub()) {
            return $this->getSub();
        }
    }

Usage Example

Example #1
0
 /**
  * testGetId
  *
  * @since 2.4.0
  *
  * @param string $route
  * @param array $expectArray
  *
  * @dataProvider providerParameter
  */
 public function testGetId($route = null, $expectArray = [])
 {
     /* setup */
     $this->_request->setQuery('p', $route);
     $parameter = new Router\Parameter($this->_request);
     $parameter->init();
     /* actual */
     $actual = $parameter->getId();
     /* compare */
     $this->assertEquals($expectArray['id'], $actual);
 }