Guest User

Untitled

a guest
Apr 7th, 2011
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.15 KB | None | 0 0
  1. <?php
  2. namespace Application\LocationBundle\Document;
  3.  
  4. use Doctrine\ODM\MongoDB\SoftDelete\SoftDeleteable;
  5.  
  6. /**
  7.  * @mongodb:Document(
  8.  *   collection="country"
  9.  * )
  10.  * @Indexes({
  11.  *   @Index(keys={"iocCode"="asc", unique=true}),
  12.  *   @Index(keys={"name"="asc"}),
  13.  *   @Index(keys={"nameI18N"="asc"})
  14.  * })
  15.  */
  16. class Country implements SoftDeleteable
  17. {
  18.     /**
  19.      * Id
  20.      *
  21.      * @var \MongoId
  22.      * @mongodb:Id
  23.      */
  24.     protected $id = null;
  25.  
  26.     /**
  27.      * The official IOC Code of this Country
  28.      *
  29.      * @mongodb:Field(type="string")
  30.      * @var string
  31.      */
  32.     protected $iocCode;
  33.  
  34.     /**
  35.      * The English name of this country
  36.      *
  37.      * @mongodb:Field(type="string");
  38.      * @var string
  39.      */
  40.     protected $name;
  41.  
  42.     /**
  43.      * Contains the name of a country with mapped the language code
  44.      *   lang: string
  45.      *   name: string
  46.      *
  47.      * @mongodb:Field(type="hash")
  48.      * @var Hash
  49.      */
  50.     protected $nameI18N;
  51.  
  52.     /**
  53.      * Counts the registered users for every country to start everywhere with the
  54.      * same base number for registration
  55.      *
  56.      * @mongodb:Field(type="int")
  57.      * @Increment
  58.      * @var Integer
  59.      */
  60.     protected $userAmount = 10000;
  61.  
  62.     /**
  63.      * contains a date when this user is deleted
  64.      *
  65.      * @mongodb:Field(type="date")
  66.      * @var MongoDate
  67.      */
  68.     protected $deletedAt;
  69.  
  70.     /**
  71.      * Get id
  72.      *
  73.      * @return id $id
  74.      */
  75.     public function getId()
  76.     {
  77.         return $this->id;
  78.     }
  79.  
  80.     /**
  81.      * Set iocCode
  82.      *
  83.      * @param string $iocCode
  84.      */
  85.     public function setIocCode($iocCode)
  86.     {
  87.         $this->iocCode = $iocCode;
  88.     }
  89.  
  90.     /**
  91.      * Get iocCode
  92.      *
  93.      * @return string $iocCode
  94.      */
  95.     public function getIocCode()
  96.     {
  97.         return $this->iocCode;
  98.     }
  99.  
  100.     /**
  101.      * Set name
  102.      *
  103.      * @param string $name
  104.      */
  105.     public function setName($name)
  106.     {
  107.         $this->name = $name;
  108.     }
  109.  
  110.     /**
  111.      * Get name
  112.      *
  113.      * @return string $name
  114.      */
  115.     public function getName()
  116.     {
  117.         return $this->name;
  118.     }
  119.  
  120.     /**
  121.      * Set nameI18N
  122.      *
  123.      * @param hash $nameI18N
  124.      */
  125.     public function setNameI18N($nameI18N)
  126.     {
  127.         $this->nameI18N = $nameI18N;
  128.     }
  129.  
  130.     /**
  131.      * Get nameI18N
  132.      *
  133.      * @return hash $nameI18N
  134.      */
  135.     public function getNameI18N()
  136.     {
  137.         return $this->nameI18N;
  138.     }
  139.  
  140.     /**
  141.      * Set userAmount
  142.      *
  143.      * @param int $userAmount
  144.      */
  145.     public function setUserAmount($userAmount)
  146.     {
  147.         $this->userAmount = $userAmount;
  148.     }
  149.  
  150.     /**
  151.      * Get userAmount
  152.      *
  153.      * @return int $userAmount
  154.      */
  155.     public function getUserAmount()
  156.     {
  157.         return $this->userAmount;
  158.     }
  159.  
  160.     /**
  161.      * Increments the UserAmount
  162.      */
  163.     public function incrementUserAmount()
  164.     {
  165.       $this->userAmount++;
  166.     }
  167.  
  168.     /**
  169.      * If this object is deleted, this will return a date
  170.      *
  171.      * @return MongoDate
  172.      */
  173.     public function getDeletedAt()
  174.     {
  175.       return $this->deletedAt;
  176.     }
  177. }
Advertisement
Add Comment
Please, Sign In to add comment