Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reading from Google Calendar .ics Exception: Call to a member function getParameters() on array #16

Open
nelwa opened this issue May 3, 2020 · 0 comments

Comments

@nelwa
Copy link

nelwa commented May 3, 2020

Hi,

This code (as in example folder):

$icalfeed = 'myGoogleCalendarPrivateICSUrl';
$icalfeed = file_get_contents($icalfile);
$icalobj = new ZCiCal($icalfeed);

echo "Number of events found: " . $icalobj->countEvents() . "\n";

$ecount = 0;

// read back icalendar data that was just parsed
if(isset($icalobj->tree->child))
{
	foreach($icalobj->tree->child as $node)
	{
		if($node->getName() == "VEVENT")
		{
			$ecount++;
			echo "<br /><br />Event $ecount:\n";
			foreach($node->data as $key => $value)
			{
				if(is_array($value))
				{
					for($i = 0; $i < count($value); $i++)
					{
						$p = $value[$i]->getParameters();
						echo "  $key: " . $value[$i]->getValues() . "\n";
					}
				}
				else
				{
					echo "  $key: " . $value->getValues() . "\n";
				}
			}
		}
	}
}

Produces this error:

Error Object
(
    [message:protected] => Call to a member function getParameters() on array
    [string:Error:private] => 
    [code:protected] => 0
    [file:protected] => /test_scripts/cal.php
    [line:protected] => 31
    [trace:Error:private] => Array
        (
        )

    [previous:Error:private] => 
)

Please help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant