LdapTools\Ldif\LdifParser::parseEntry PHP 메소드

parseEntry() 보호된 메소드

Parse an entry from the DN position until we reach the start of the next entry. Return the entry that was parsed.
protected parseEntry ( ) : LdapTools\Ldif\Entry\LdifEntryInterface
리턴 LdapTools\Ldif\Entry\LdifEntryInterface
    protected function parseEntry()
    {
        $entry = $this->parseCommonDirectives($this->getKeyAndValue($this->currentLine())[1]);
        if (!empty($this->commentQueue)) {
            $entry->addComment(...$this->commentQueue);
            $this->commentQueue = [];
        }
        // Nothing further to do with a simple deletion...
        if ($entry instanceof LdifEntryDelete) {
            return $entry;
        }
        while (!$this->isEndOfLdif() && !$this->isStartOfEntry()) {
            if ($this->isComment()) {
                $entry->addComment(substr($this->currentLine(), 1));
                $this->nextLine();
            } elseif ($this->isEndOfEntry()) {
                break;
            } else {
                list($key, $value) = $this->getKeyAndValue($this->currentLine());
                $this->addDirectiveToEntry($key, $value, $entry);
                $this->nextLine();
            }
        }
        return $entry;
    }