public function getAddressBooksForUser($principalUri)
    {
        $stmt = $this->pdo->prepare('SELECT id, uri, displayname, principaluri, description, synctoken FROM '.$this->addressBooksTableName.' WHERE principaluri = ?');
        $stmt->execute([$principalUri]);

        $addressBooks = [];

        foreach ($stmt->fetchAll() as $row) {
            $addressBooks[] = [
                'id' => $row['id'],
                'uri' => $row['uri'],
                'principaluri' => $row['principaluri'],
                '{DAV:}displayname' => $row['displayname'],
                '{'.CardDAV\Plugin::NS_CARDDAV.'}addressbook-description' => $row['description'],
                '{http://calendarserver.org/ns/}getctag' => $row['synctoken'],
                '{http://sabredav.org/ns}sync-token' => $row['synctoken'] ? $row['synctoken'] : '0',
            ];
        }

        return $addressBooks;
    }
public function getAddressBooksForUser($principalUri)
    {
        $stmt = $this->pdo->prepare('SELECT id, uri, displayname, principaluri, description, synctoken FROM '.$this->addressBooksTableName.' WHERE principaluri = ?');
        $stmt->execute([$principalUri]);

        $addressBooks = [];

        foreach ($stmt->fetchAll() as $row) {
            $addressBooks[] = [
                'id' => $row['id'],
                'uri' => $row['uri'],
                'principaluri' => $row['principaluri'],
                '{DAV:}displayname' => $row['displayname'],
                '{'.CardDAV\Plugin::NS_CARDDAV.'}addressbook-description' => $row['description'],
                '{http://calendarserver.org/ns/}getctag' => $row['synctoken'],
                '{http://sabredav.org/ns}sync-token' => $row['synctoken'] ? $row['synctoken'] : '0',
            ];
        }

        return $addressBooks;
    }
public function getAddressBooksForUser ( $ principalUri ) { $ stmt = $ this -> pdo -> prepare ( 'SELECT id, uri, displayname, principaluri, description, synctoken FROM ' . $ this -> addressBooksTableName . ' WHERE principaluri = ?' ) ; $ stmt -> execute ( [ $ principalUri ] ) ; $ addressBooks = [ ] ; foreach ( $ stmt -> fetchAll ( ) as $ row ) { $ addressBooks [ ] = [ 'id' => $ row [ 'id' ] , 'uri' => $ row [ 'uri' ] , 'principaluri' => $ row [ 'principaluri' ] , '{DAV:}displayname' => $ row [ 'displayname' ] , '{' . CardDAV \ Plugin :: NS_CARDDAV . '}addressbook-description' => $ row [ 'description' ] , '{http://calendarserver.org/ns/}getctag' => $ row [ 'synctoken' ] , '{http://sabredav.org/ns}sync-token' => $ row [ 'synctoken' ] ? $ row [ 'synctoken' ] : '0' , ] ; } return $ addressBooks ; }
Returns the list of addressbooks for a specific user.

@param string $principalUri

@return array
Returns the list of addressbooks for a specific user .