Advertisement
Guest User

Untitled

a guest
May 23rd, 2012
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 14.03 KB | None | 0 0
  1. <?php
  2.  
  3. use Doctrine\ORM\Mapping as ORM;
  4.  
  5. namespace Entity;
  6.  
  7. /**
  8.  * Entity\Cloud
  9.  *
  10.  * @orm:Table(name="cloud")
  11.  * @orm:Entity
  12.  * @orm:HasLifecycleCallbacks
  13.  */
  14. class Cloud
  15. {
  16.     /**
  17.      * @var integer $id
  18.      *
  19.      * @orm:Column(name="id", type="integer", length="13")
  20.      * @orm:Id
  21.      * @orm:GeneratedValue(strategy="IDENTITY")
  22.      */
  23.     private $id;
  24.  
  25.     /**
  26.      * @var Entity\User
  27.      *
  28.      * @orm:ManyToOne(targetEntity="User", inversedBy="cloudList")
  29.      */
  30.     private $user;
  31.  
  32.     /**
  33.      * @var Entity\Instance
  34.      *
  35.      * @orm:ManyToOne(targetEntity="Instance")
  36.      */
  37.     #private $topic_instance;
  38.  
  39.     /**
  40.      * @var float $position_x
  41.      *
  42.      * @orm:Column(name="position_x", type="float", length=9)
  43.      */
  44.     private $position_x;
  45.  
  46.     /**
  47.      * @var float $position_y
  48.      *
  49.      * @orm:Column(name="position_y", type="float", length=9)
  50.      */
  51.     private $position_y;
  52.  
  53.     /**
  54.      * @var boolean $is_public
  55.      *
  56.      * @orm:Column(name="is_public", type="boolean")
  57.      */
  58.     private $is_public;
  59.  
  60.     /**
  61.      * @var Entity\Cloud
  62.      *
  63.      * @orm:ManyToOne(targetEntity="Cloud", inversedBy="children")
  64.      */
  65.     private $parent;
  66.  
  67.     /**
  68.      * @var Entity\Cloud
  69.      *
  70.      * @orm:OneToMany(targetEntity="Cloud", mappedBy="parent")
  71.      */
  72.     private $children;
  73.  
  74.     /**
  75.      * @var integer $left_node
  76.      *
  77.      * @orm:Column(name="left_node", type="integer", nullable=true)
  78.      */
  79.     private $left_node;
  80.  
  81.     /**
  82.      * @var integer $right_node
  83.      *
  84.      * @orm:Column(name="right_node", type="integer", nullable=true)
  85.      */
  86.     private $right_node;
  87.  
  88.     /**
  89.      * @var integer $topic_level
  90.      *
  91.      * @orm:Column(name="topic_level", type="integer", nullable=true)
  92.      */
  93.     private $topic_level;
  94.  
  95.     /**
  96.      * @var float $attraction_force
  97.      *
  98.      * @orm:Column(name="attraction_force", type="float", nullable=true)
  99.      */
  100.     private $attraction_force;
  101.  
  102.     /**
  103.      * @var float $repulsion_force
  104.      *
  105.      * @orm:Column(name="repulsion_force", type="float", nullable=true)
  106.      */
  107.     private $repulsion_force;
  108.  
  109.     /**
  110.      * @var integer $repulsion_dist
  111.      *
  112.      * @orm:Column(name="repulsion_dist", type="float", nullable=true)
  113.      */
  114.     private $repulsion_dist;
  115.  
  116.     /**
  117.      * @var float $gravitation_force
  118.      *
  119.      * @orm:Column(name="gravitation_force", type="float", nullable=true)
  120.      */
  121.     private $gravitation_force;
  122.  
  123.     /**
  124.      * @var string $commit_group
  125.      *
  126.      * @orm:Column(name="commit_group", type="string", length=32, nullable=true)
  127.      */
  128.     private $commit_group;
  129.  
  130.     /**
  131.      * @var string $commit_key
  132.      *
  133.      * @orm:Column(name="commit_key", type="string", length=13, nullable=true)
  134.      */
  135.     private $commit_key;
  136.    
  137.     /**
  138.      * @var string $record_checksum
  139.      *
  140.      * @orm:Column(name="record_checksum", type="string", length=32, nullable=true)
  141.      */
  142.     private $record_checksum;
  143.    
  144.  
  145.  
  146.  
  147.     /**
  148.      * @var datetime $created_at
  149.      *
  150.      * @orm:Column(name="created_at", type="datetime", nullable=false)
  151.      */
  152.     private $created_at;
  153.  
  154.     /**
  155.      * @var datetime $updated_at
  156.      *
  157.      * @orm:Column(name="updated_at", type="datetime", nullable=false)
  158.      */
  159.     private $updated_at;
  160.  
  161.  
  162.     /**
  163.      * @var Entity\Cloud
  164.      *
  165.      * @orm:ManyToMany(targetEntity="Cloud", mappedBy="linkedTo")
  166.      */
  167.     private $linkedToMe;
  168.  
  169.     /**
  170.      * @var Entity\Cloud
  171.      *
  172.      * @orm:ManyToMany(targetEntity="Cloud", inversedBy="linkedToMe")
  173.      * @orm:JoinTable(name="cloud_link",
  174.      *      joinColumns={@orm:JoinColumn(name="cloud_id", referencedColumnName="id")},
  175.      *      inverseJoinColumns={@orm:JoinColumn(name="linked_cloud_id", referencedColumnName="id")}
  176.      *      )
  177.      */
  178.     private $linkedTo;
  179.  
  180.     /**
  181.      * @var Application\BackEnd\Entity\Instance
  182.      *
  183.      * @orm:OneToMany(targetEntity="Instance", mappedBy="cloud", cascade={"remove"})
  184.      */
  185.     private $instanceList;
  186.    
  187.     /**
  188.      * @var Application\BackEnd\Entity\InstanceLink
  189.      *
  190.      * @orm:OneToMany(targetEntity="InstanceLink", mappedBy="cloud", cascade={"remove"})
  191.      */
  192.     private $instanceLink;
  193.  
  194.  
  195.      /**
  196.      * @var Entity\CloudShare
  197.      * @orm:OneToMany(targetEntity="CloudShare", mappedBy="cloud", cascade={"remove", "persist"}, orphanRemoval=true)
  198.      *
  199.      */
  200.     private $cloudShareList;
  201.    
  202.    
  203.  
  204.    
  205.    
  206.  
  207.  
  208.     public function __construct()
  209.     {
  210.         $this->children = new \Doctrine\Common\Collections\ArrayCollection();
  211.         $this->linkedToMe = new \Doctrine\Common\Collections\ArrayCollection();
  212.         $this->linkedTo = new \Doctrine\Common\Collections\ArrayCollection();
  213.         $this->instanceList = new \Doctrine\Common\Collections\ArrayCollection();
  214.         $this->instanceLink = new \Doctrine\Common\Collections\ArrayCollection();
  215.         $this->cloudShareList = new \Doctrine\Common\Collections\ArrayCollection();
  216.     }
  217.  
  218.  
  219.     /**
  220.      * Hook to call when a new object is created
  221.      *
  222.      * @orm:PrePersist
  223.      */
  224.     public function doStuffOnPrePersist()
  225.     {
  226.         $date = new \DateTime();
  227.         $this->setCreatedAt($date);
  228.         $this->setUpdatedAt($date);
  229.     }
  230.  
  231.     /**
  232.      * Hook to call when an existing object is updated
  233.      *
  234.      * @orm:PreUpdate
  235.      */
  236.     public function doStuffOnPreUpdate()
  237.     {
  238.         $date = new \DateTime();
  239.         $this->setUpdatedAt($date);
  240.     }
  241.  
  242.    
  243.    
  244.    
  245.     /**
  246.      * Returns a list of clouds for this user
  247.      *
  248.      * @return Doctrine\Common\Collections\Collection
  249.      */
  250.     public function getCloudShares()
  251.     {
  252.         return $this->cloudShareList;
  253.     }
  254.  
  255.  
  256.  
  257.  
  258.     /**
  259.      * Get id
  260.      *
  261.      * @return integer $id
  262.      */
  263.     public function getId()
  264.     {
  265.         return $this->id;
  266.     }
  267.  
  268.     /**
  269.      * Set position_x
  270.      *
  271.      * @param float $positionX
  272.      */
  273.     public function setPositionX($positionX)
  274.     {
  275.         $this->position_x = $positionX;
  276.     }
  277.  
  278.     /**
  279.      * Get position_x
  280.      *
  281.      * @return float $positionX
  282.      */
  283.     public function getPositionX()
  284.     {
  285.         return $this->position_x;
  286.     }
  287.  
  288.     /**
  289.      * Set position_y
  290.      *
  291.      * @param float $positionY
  292.      */
  293.     public function setPositionY($positionY)
  294.     {
  295.         $this->position_y = $positionY;
  296.     }
  297.  
  298.     /**
  299.      * Get position_y
  300.      *
  301.      * @return float $positionY
  302.      */
  303.     public function getPositionY()
  304.     {
  305.         return $this->position_y;
  306.     }
  307.  
  308.     /**
  309.      * Set is_public
  310.      *
  311.      * @param boolean $isPublic
  312.      */
  313.     public function setIsPublic($isPublic)
  314.     {
  315.         $this->is_public = $isPublic;
  316.     }
  317.  
  318.     /**
  319.      * Get is_public
  320.      *
  321.      * @return boolean $isPublic
  322.      */
  323.     public function getIsPublic()
  324.     {
  325.         return $this->is_public;
  326.     }
  327.  
  328.     /**
  329.      * Set left_node
  330.      *
  331.      * @param integer $leftNode
  332.      */
  333.     public function setLeftNode($leftNode)
  334.     {
  335.         $this->left_node = $leftNode;
  336.     }
  337.  
  338.     /**
  339.      * Get left_node
  340.      *
  341.      * @return integer $leftNode
  342.      */
  343.     public function getLeftNode()
  344.     {
  345.         return $this->left_node;
  346.     }
  347.  
  348.     /**
  349.      * Set right_node
  350.      *
  351.      * @param integer $rightNode
  352.      */
  353.     public function setRightNode($rightNode)
  354.     {
  355.         $this->right_node = $rightNode;
  356.     }
  357.  
  358.     /**
  359.      * Get right_node
  360.      *
  361.      * @return integer $rightNode
  362.      */
  363.     public function getRightNode()
  364.     {
  365.         return $this->right_node;
  366.     }
  367.  
  368.     /**
  369.      * Set topic_level
  370.      *
  371.      * @param integer $topicLevel
  372.      */
  373.     public function setTopicLevel($topicLevel)
  374.     {
  375.         $this->topic_level = $topicLevel;
  376.     }
  377.  
  378.     /**
  379.      * Get topic_level
  380.      *
  381.      * @return integer $topicLevel
  382.      */
  383.     public function getTopicLevel()
  384.     {
  385.         return $this->topic_level;
  386.     }
  387.  
  388.     /**
  389.      * Set attraction_force
  390.      *
  391.      * @param float $attractionForce
  392.      */
  393.     public function setAttractionForce($attractionForce)
  394.     {
  395.         $this->attraction_force = $attractionForce;
  396.     }
  397.  
  398.     /**
  399.      * Get attraction_force
  400.      *
  401.      * @return float $attractionForce
  402.      */
  403.     public function getAttractionForce()
  404.     {
  405.         return $this->attraction_force;
  406.     }
  407.  
  408.     /**
  409.      * Set repulsion_force
  410.      *
  411.      * @param float $repulsionForce
  412.      */
  413.     public function setRepulsionForce($repulsionForce)
  414.     {
  415.         $this->repulsion_force = $repulsionForce;
  416.     }
  417.  
  418.     /**
  419.      * Get repulsion_force
  420.      *
  421.      * @return float $repulsionForce
  422.      */
  423.     public function getRepulsionForce()
  424.     {
  425.         return $this->repulsion_force;
  426.     }
  427.  
  428.     /**
  429.      * Set repulsion_dist
  430.      *
  431.      * @param integer $repulsionDist
  432.      */
  433.     public function setRepulsionDist($repulsionDist)
  434.     {
  435.         $this->repulsion_dist = $repulsionDist;
  436.     }
  437.  
  438.     /**
  439.      * Get repulsion_dist
  440.      *
  441.      * @return integer $repulsionDist
  442.      */
  443.     public function getRepulsionDist()
  444.     {
  445.         return $this->repulsion_dist;
  446.     }
  447.  
  448.     /**
  449.      * Set gravitation_force
  450.      *
  451.      * @param float $gravitationForce
  452.      */
  453.     public function setGravitationForce($gravitationForce)
  454.     {
  455.         $this->gravitation_force = $gravitationForce;
  456.     }
  457.  
  458.     /**
  459.      * Get gravitation_force
  460.      *
  461.      * @return float $gravitationForce
  462.      */
  463.     public function getGravitationForce()
  464.     {
  465.         return $this->gravitation_force;
  466.     }
  467.  
  468.     /**
  469.      * Get commit_group
  470.      *
  471.      * @return string $commitGroup
  472.      */
  473.     public function getCommitGroup()
  474.     {
  475.         return $this->commit_group;
  476.     }
  477.  
  478.     /**
  479.      * Set commit_group
  480.      *
  481.      * @param string $commitGroup
  482.      */
  483.     public function setCommitGroup($commitGroup)
  484.     {
  485.         $this->commit_group = $commitGroup;
  486.     }
  487.  
  488.     /**
  489.      * Get commit_key
  490.      *
  491.      * @return string $commitKey
  492.      */
  493.     public function getCommitKey()
  494.     {
  495.         return $this->commit_key;
  496.     }
  497.  
  498.     /**
  499.      * Set commit_key
  500.      *
  501.      * @param string $commitKey
  502.      */
  503.     public function setCommitKey($commitKey)
  504.     {
  505.         $this->commit_key = $commitKey;
  506.     }
  507.    
  508.     /**
  509.      * Get record_checksum
  510.      *
  511.      * @return string $recordChecksum
  512.      */
  513.     public function getRecordChecksum()
  514.     {
  515.         return $this->record_checksum;
  516.     }
  517.  
  518.     /**
  519.      * Set record_checksum
  520.      *
  521.      * @param string $recordChecksum
  522.      */
  523.     public function setRecordChecksum($recordChecksum)
  524.     {
  525.         $this->record_checksum = $recordChecksum;
  526.     }
  527.  
  528.  
  529.     /**
  530.      * Set created_at
  531.      *
  532.      * @param datetime $createdAt
  533.      */
  534.     public function setCreatedAt($createdAt)
  535.     {
  536.         $this->created_at = $createdAt;
  537.     }
  538.  
  539.     /**
  540.      * Get created_at
  541.      *
  542.      * @return datetime $createdAt
  543.      */
  544.     public function getCreatedAt()
  545.     {
  546.         return $this->created_at;
  547.     }
  548.  
  549.     /**
  550.      * Set updated_at
  551.      *
  552.      * @param datetime $updatedAt
  553.      */
  554.     public function setUpdatedAt($updatedAt)
  555.     {
  556.         $this->updated_at = $updatedAt;
  557.     }
  558.  
  559.     /**
  560.      * Get updated_at
  561.      *
  562.      * @return datetime $updatedAt
  563.      */
  564.     public function getUpdatedAt()
  565.     {
  566.         return $this->updated_at;
  567.     }
  568.  
  569.     /**
  570.      * Set user
  571.      *
  572.      * @param Entity\User $user
  573.      */
  574.     public function setUser(\Entity\User $user)
  575.     {
  576.         $this->user = $user;
  577.     }
  578.  
  579.     /**
  580.      * Get user
  581.      *
  582.      * @return Entity\User $user
  583.      */
  584.     public function getUser()
  585.     {
  586.         return $this->user;
  587.     }
  588.  
  589.     /**
  590.      * Set topic_instance
  591.      *
  592.      * @param Entity\Instance $topicInstance
  593.      */
  594.     /*public function setTopicInstance(\Entity\Instance $topicInstance)
  595.     {
  596.         $this->topic_instance = $topicInstance;
  597.     }*/
  598.  
  599.     /**
  600.      * Get topic_instance
  601.      *
  602.      * @return Entity\Instance $topicInstance
  603.      */
  604.     /*public function getTopicInstance()
  605.     {
  606.         return $this->topic_instance;
  607.     }*/
  608.  
  609.     /**
  610.      * Set parent
  611.      *
  612.      * @param Entity\Cloud $parent
  613.      */
  614.     public function setParent(\Entity\Cloud $parent)
  615.     {
  616.         $this->parent = $parent;
  617.     }
  618.  
  619.     /**
  620.      * Get parent
  621.      *
  622.      * @return Entity\Cloud $parent
  623.      */
  624.     public function getParent()
  625.     {
  626.         return $this->parent;
  627.     }
  628.  
  629.     /**
  630.      * Add children
  631.      *
  632.      * @param Entity\Cloud $children
  633.      */
  634.     public function addChildren(\Entity\Cloud $children)
  635.     {
  636.         $this->children[] = $children;
  637.     }
  638.  
  639.     /**
  640.      * Get children
  641.      *
  642.      * @return Doctrine\Common\Collections\Collection $children
  643.      */
  644.     public function getChildren()
  645.     {
  646.         return $this->children;
  647.     }
  648.  
  649.     /**
  650.      * Add linkedToMe
  651.      *
  652.      * @param Entity\Cloud $linkedToMe
  653.      */
  654.     public function addLinkedToMe(\Entity\Cloud $linkedToMe)
  655.     {
  656.         $this->linkedToMe[] = $linkedToMe;
  657.     }
  658.  
  659.     /**
  660.      * Get linkedToMe
  661.      *
  662.      * @return Doctrine\Common\Collections\Collection $linkedToMe
  663.      */
  664.     public function getLinkedToMe()
  665.     {
  666.         return $this->linkedToMe;
  667.     }
  668.  
  669.     /**
  670.      * Add linkedTo
  671.      *
  672.      * @param Entity\Cloud $linkedTo
  673.      */
  674.     public function addLinkedTo(\Entity\Cloud $linkedTo)
  675.     {
  676.         $this->linkedTo[] = $linkedTo;
  677.     }
  678.  
  679.     /**
  680.      * Get linkedTo
  681.      *
  682.      * @return Doctrine\Common\Collections\Collection $linkedTo
  683.      */
  684.     public function getLinkedTo()
  685.     {
  686.         return $this->linkedTo;
  687.     }
  688.  
  689.     /**
  690.      * Add instanceList
  691.      *
  692.      * @param Entity\Instance $instanceList
  693.      */
  694.     public function addInstanceList(\Entity\Instance $instanceList)
  695.     {
  696.         $this->instanceList[] = $instanceList;
  697.     }
  698.  
  699.     /**
  700.      * Get instanceList
  701.      *
  702.      * @return Doctrine\Common\Collections\Collection $instanceList
  703.      */
  704.     public function getInstanceList()
  705.     {
  706.         return $this->instanceList;
  707.     }
  708. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement