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

Add geographic position property to event #66

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/Eluceo/iCal/Component/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
use Eluceo\iCal\PropertyBag;
use Eluceo\iCal\Property\Event\RecurrenceId;
use Eluceo\iCal\Property\DateTimesProperty;
use Eluceo\iCal\Property\GeoValue;

/**
* Implementation of the EVENT component.
Expand Down Expand Up @@ -273,6 +274,10 @@ public function buildPropertyBag()
}
}

if (null != $this->locationGeo) {
$propertyBag->set('GEO', new GeoValue($this->locationGeo));
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@psztucz Why do we need a ValueObject when there is no logic at all in there?

}

if (null != $this->summary) {
$propertyBag->set('SUMMARY', $this->summary);
}
Expand Down
46 changes: 46 additions & 0 deletions src/Eluceo/iCal/Property/GeoValue.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?php

namespace Eluceo\iCal\Property;

class GeoValue implements ValueInterface
{
/**
* The value.
*
* @var string
*/
protected $value;

public function __construct($value)
{
$this->value = $value;
}

/**
* @return string
*/
public function getEscapedValue()
{
return $this->value;
}

/**
* @param string $value
*
* @return $this
*/
public function setValue($value)
{
$this->value = $value;

return $this;
}

/**
* @return string
*/
public function getValue()
{
return $this->value;
}
}