vcard icon indicating copy to clipboard operation
vcard copied to clipboard

Fatal error: Uncaught Error: Call to undefined method JeroenDesloovere\VCard\VCard::addURL()

Open inpresif opened this issue 4 years ago • 0 comments

I've been trying to add a URL, both clean from the sample code as well as the social TYPE= versions, but I'm not getting it to work.

As the title suggests, this is the error: Fatal error: Uncaught Error: Call to undefined method JeroenDesloovere\VCard\VCard::addURL()

Here's some code:

$vcard = new VCard();
$vcard->add(new Name($lastname, $firstname, $additional, $prefix, $suffix))
        ->add(new Nickname('BotNinja'))
        ->add(new Address(null, null, $streetAndNumber, $city, $state, $zipcode, $country, Type::work()))
        ->add(new Email($email, Type::work()))
        ->add(new Note($specialNote))
        ->add(new Telephone($phone))
        ->add(new Photo($photo))
        //->add(new addUrl($webUrl,"TYPE=WEBSITE"))
;

//$vcard->addURL('https://www.facebook.com/username','TYPE=Facebook');
$vcard->addURL('http://www.jeroendesloovere.be');

You can see what I commented out, also has been tried.

Am I missing something? Without the URL all works fine, using this setup (using all "use" paths now and will cleanup when done):

require_once __DIR__ . "/vendor/autoload.php";

/*
 * Use Classes
 */

use JeroenDesloovere\VCard\Exception\VCardException;
use JeroenDesloovere\VCard\Formatter\Formatter;
use JeroenDesloovere\VCard\Formatter\VcfFormatter;
use JeroenDesloovere\VCard\Property\Address;
use JeroenDesloovere\VCard\Property\Anniversary;
use JeroenDesloovere\VCard\Property\Birthdate;
use JeroenDesloovere\VCard\Property\Email;
use JeroenDesloovere\VCard\Property\FullName;
use JeroenDesloovere\VCard\Property\Gender;
use JeroenDesloovere\VCard\Property\Logo;
use JeroenDesloovere\VCard\Property\Name;
use JeroenDesloovere\VCard\Property\Nickname;
use JeroenDesloovere\VCard\Property\NodeInterface;
use JeroenDesloovere\VCard\Property\Note;
use JeroenDesloovere\VCard\Property\Parameter\Kind;
use JeroenDesloovere\VCard\Property\Parameter\PropertyParameterInterface;
use JeroenDesloovere\VCard\Property\Parameter\Revision;
use JeroenDesloovere\VCard\Property\Parameter\Type;
use JeroenDesloovere\VCard\Property\Parameter\Version;
use JeroenDesloovere\VCard\Property\Photo;
use JeroenDesloovere\VCard\Property\PropertyInterface;
use JeroenDesloovere\VCard\Property\Role;
use JeroenDesloovere\VCard\Property\Telephone;
use JeroenDesloovere\VCard\Property\Title;

use JeroenDesloovere\VCard\VCard;

EDIT: I see in the readme doc for the latest version, which I installed with composer, there is an unchecked URL reference: in the Explanatory Properties. I assume this means that isn't ported to the latest version yet?

If so, I'll get an earlier version, thanks

inpresif avatar Jan 01 '21 15:01 inpresif