src/Rest/Factory.php
public function create($uri, $content)
    {
        $uri = '/' . trim($uri, '/');

        foreach ($this->patterns as $pattern => $key) {
            if (preg_match($pattern, $uri)) {
                return call_user_func($this->builders[$key], (array) $content);
            }
        }

        throw new RuntimeException(sprintf('Cannot create resource by URI "%s"', $uri));
    }
public function create($uri, $content)
    {
        $uri = '/' . trim($uri, '/');

        foreach ($this->patterns as $pattern => $key) {
            if (preg_match($pattern, $uri)) {
                return call_user_func($this->builders[$key], (array) $content);
            }
        }

        throw new RuntimeException(sprintf('Cannot create resource by URI "%s"', $uri));
    }
public function create ( $ uri , $ content ) { $ uri = '/' . trim ( $ uri , '/' ) ; foreach ( $ this -> patterns as $ pattern => $ key ) { if ( preg_match ( $ pattern , $ uri ) ) { return call_user_func ( $ this -> builders [ $ key ] , ( array ) $ content ) ; } } throw new RuntimeException ( sprintf ( 'Cannot create resource by URI "%s"' , $ uri ) ) ; }
Create resource object by URI template and resource data.

@param string $uri
@param array $content

@throws RuntimeException

@return mixed|Collection|Entity|Entity[]
Create resource object by URI template and resource data .