Skip to content

Commit

Permalink
Add encoded polyline entity + ORM mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
GeLoLabs committed Nov 24, 2011
1 parent 6694b4a commit 3b1c54e
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 0 deletions.
25 changes: 25 additions & 0 deletions Entity/EncodedPolyline.php
@@ -0,0 +1,25 @@
<?php

namespace Ivory\GoogleMapBundle\Entity;

use Ivory\GoogleMapBundle\Model\Overlays\EncodedPolyline as BaseEncodedPolyline;

/**
* Encoded Polyline Entity
*
* @author GeLo <geloen.eric@gmail.com>
*/
class EncodedPolyline extends BaseEncodedPolyline
{
/**
* Create an encoded polyline
*
* @param string $value
*/
public function __construct($value = null)
{
parent::__construct($value);
}
}

?>
13 changes: 13 additions & 0 deletions Resources/config/doctrine/EncodedPolyline.orm.xml
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8" ?>

<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd">

<mapped-superclass name="Ivory\GoogleMapBundle\Entity\EncodedPolyline" table="ivory_encoded_polyline">
<field name="javascriptVariable" column="javascript_variable" type="string" length="100" />
<field name="value" type="text" />
<field name="options" type="array" />
</mapped-superclass>

</doctrine-mapping>
22 changes: 22 additions & 0 deletions Tests/Entity/EncodedPolylineTest.php
@@ -0,0 +1,22 @@
<?php

namespace Ivory\GoogleMapBundle\Tests\Entity;

use Ivory\GoogleMapBundle\Entity\EncodedPolyline;

/**
* Encoded Polyline Test
*
* @author GeLo <geloen.eric@gmail.com>
*/
class EncodedPolylineTest extends \PHPUnit_Framework_TestCase
{
/**
* Checks the encoded polyline constuctor
*/
public function testConstructor()
{
$encodedPolylineEntityTest = new EncodedPolyline();
$this->assertInstanceOf('Ivory\GoogleMapBundle\Model\Overlays\EncodedPolyline', $encodedPolylineEntityTest);
}
}

0 comments on commit 3b1c54e

Please sign in to comment.