PHP Class JeroenDesloovere\VCard\VCardParser

This class is heavily based on the Zendvcard project (seemingly abandoned), which is licensed under the Apache 2.0 license. More information can be found at https://code.google.com/archive/p/zendvcard/
Author: Thomas Schaaf ([email protected])
Author: ruzicka.jan
Author: Wouter Admiraal ([email protected])
Inheritance: implements Iterato\Iterator
Afficher le fichier Open project: jeroendesloovere/vcard Class Usage Examples

Protected Properties

Свойство Type Description
$content string The raw VCard content.
$position integer The iterator position.
$vcardObjects array The VCard data objects.

Méthodes publiques

Méthode Description
__construct ( $content )
current ( )
getCardAtIndex ( integer $i ) : stdClass Fetch the imported VCard at the specified index.
getCards ( ) : array Fetch all the imported VCards.
key ( )
next ( )
parseFromFile ( string $filename ) : JeroenDesloovere\VCard\VCardParser Helper function to parse a file directly.
rewind ( )
valid ( )

Méthodes protégées

Méthode Description
parse ( ) Start the parsing process.
parseAddress ( $value )
parseBirthday ( $value )
parseName ( $value )
unescape ( string $text ) : string Unescape newline characters according to RFC2425 section 5.8.4.

Method Details

__construct() public méthode

public __construct ( $content )

current() public méthode

public current ( )

getCardAtIndex() public méthode

Fetch the imported VCard at the specified index.
public getCardAtIndex ( integer $i ) : stdClass
$i integer
Résultat stdClass The card data object.

getCards() public méthode

Fetch all the imported VCards.
public getCards ( ) : array
Résultat array A list of VCard card data objects.

key() public méthode

public key ( )

next() public méthode

public next ( )

parse() protected méthode

This method will populate the data object.
protected parse ( )

parseAddress() protected méthode

protected parseAddress ( $value )

parseBirthday() protected méthode

protected parseBirthday ( $value )

parseFromFile() public static méthode

Helper function to parse a file directly.
public static parseFromFile ( string $filename ) : JeroenDesloovere\VCard\VCardParser
$filename string
Résultat JeroenDesloovere\VCard\VCardParser

parseName() protected méthode

protected parseName ( $value )

rewind() public méthode

public rewind ( )

unescape() protected méthode

This function will replace escaped line breaks with PHP_EOL.
protected unescape ( string $text ) : string
$text string
Résultat string

valid() public méthode

public valid ( )

Property Details

$content protected_oe property

The raw VCard content.
protected string $content
Résultat string

$position protected_oe property

The iterator position.
protected int $position
Résultat integer

$vcardObjects protected_oe property

The VCard data objects.
protected array $vcardObjects
Résultat array