Skip to content

Instantly share code, notes, and snippets.

@ornicar
Created October 29, 2010 21:29
Show Gist options
  • Save ornicar/654464 to your computer and use it in GitHub Desktop.
Save ornicar/654464 to your computer and use it in GitHub Desktop.
<?php
/**
* @mongodb:Document
*/
class Band
{
/**
* @mongodb:Field(type="string")
* @var string
*/
protected $name;
}
/**
* @mongodb:Document
*/
class Artist
{
/**
* @mongodb:Field(type="string")
* @var string
*/
protected $name;
}
/**
* @mongodb:Document
*/
class Performer
{
/**
* @mongodb:ReferenceOne(targetDocument="Artist")
* @var Artist
*/
protected $artist;
/**
* @mongodb:ReferenceOne(targetDocument="Band")
* @var Band
*/
protected $band;
/**
* @mongodb:EmbedOne(targetDocument="Image")
* @var Image
*/
protected $photo;
/**
* @mongodb:Field(type="string")
* @var string
*/
protected $instrument;
}
/**
* @mongodb:EmbeddedDocument
*/
class Image
{
/**
* Relative path like "artist/alainsouchon.bmp"
*
* mongodb:Field(type="string")
* @var string
*/
protected $path;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment