Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace Doctrine\Tests\Models\GeoLocation;
- /**
- * Description of Location
- *
- * @author Guilherme Blanco <guilhermeblanco@hotmail.com>
- * @Entity
- * @Table(name="locations")
- * @InheritanceType("JOINED")
- * @DiscriminatorColumn(name="type", type="string")
- * @DiscriminatorMap({
- * "user" = "User",
- * "point" = "Point",
- * "poi" = "PointOfInterest",
- * "map" = "Map"
- * })
- */
- abstract class Location
- {
- /**
- * @Id
- * @Column(type="integer")
- * @GeneratedValue(strategy="AUTO")
- */
- private $id;
- /**
- * @Column(type="decimal", length=10)
- */
- private $latitude;
- /**
- * @Column(type="decimal", length=10)
- */
- private $longitude;
- // ...
- }
- /**
- * Description of User
- *
- * @author Guilherme Blanco <guilhermeblanco@hotmail.com>
- * @Entity
- * @Table(name="users")
- */
- class User extends Location
- {
- /**
- * @Column(type="string", length=255)
- */
- private $name;
- /**
- * @OneToMany(targetEntity="Map", mappedBy="creator")
- */
- public $maps;
- // ...
- }
- /**
- * Description of Point
- *
- * @author Guilherme Blanco <guilhermeblanco@hotmail.com>
- * @Entity
- * @Table(name="points")
- */
- class Point extends Location
- {
- }
- /**
- * Description of PointOfInterest
- *
- * @author Guilherme Blanco <guilhermeblanco@hotmail.com>
- * @Entity
- * @Table(name="pois")
- */
- class PointOfInterest extends Point
- {
- /**
- * @Column(type="string", length=255)
- */
- private $name;
- // ...
- }
- /**
- * Description of Map
- *
- * @author Guilherme Blanco <guilhermeblanco@hotmail.com>
- * @Entity
- * @Table(name="maps")
- */
- class Map extends Point
- {
- /**
- * @Column(type="string", length=255)
- */
- private $name;
- /**
- * @Column(type="integer")
- */
- private $zoom;
- /**
- * @ManyToOne(targetEntity="User")
- * @JoinColumn(name="user_id", referencedColumnName="id")
- */
- private $creator;
- // ...
- }
Add Comment
Please, Sign In to add comment