DataSift\Storyplayer\BrowserLib\BaseElementAction::retrieveElements PHP Method

retrieveElements() protected method

protected retrieveElements ( string $methodName, array $methodArgs ) : array
$methodName string
$methodArgs array
return array
    protected function retrieveElements($methodName, $methodArgs)
    {
        $words = $this->convertMethodNameToWords($methodName);
        $targetType = $this->determineTargetType($words);
        // what are we searching for?
        $searchTerm = $methodArgs[0];
        $searchType = $this->determineSearchType($words);
        if ($searchType === null) {
            // we do not understand how to find the target field
            throw new E5xx_ActionFailed(__CLASS__ . '::' . $methodName, "could not work out how to find the target to action upon");
        }
        // what tag(s) do we want to narrow our search to?
        $tag = $this->determineTagType($targetType);
        // how are we searching for matching elements?
        $searchMethod = 'getElements' . $searchType;
        // let's go find our element
        $searchObject = new DomElementSearch($this->baseElement);
        $elements = $searchObject->{$searchMethod}($searchTerm, $tag);
        // all done
        return $elements;
    }