FluentDOM\Nodes\Builder::getContentNodes PHP Метод

getContentNodes() публичный Метод

Convert a given content into and array of nodes
public getContentNodes ( mixed $content, boolean $includeTextNodes = TRUE, integer $limit ) : array
$content mixed
$includeTextNodes boolean
$limit integer
Результат array
    public function getContentNodes($content, $includeTextNodes = TRUE, $limit = -1)
    {
        $result = FALSE;
        if ($nodes = $this->getNodeList($content, $includeTextNodes, $limit)) {
            $result = $nodes;
        } elseif (is_string($content)) {
            $result = $this->getFragment($content, $this->getOwner()->contentType, $includeTextNodes, $limit);
        }
        if (!is_array($result) || empty($result)) {
            throw new \InvalidArgumentException('Invalid/empty content parameter.');
        } else {
            //if a node is not in the current document import it
            $document = $this->getOwner()->getDocument();
            foreach ($result as $index => $node) {
                if ($node->ownerDocument !== $document) {
                    $result[$index] = $document->importNode($node, TRUE);
                }
            }
        }
        return $result;
    }