Commit 36ab21cc authored by Mat's avatar Mat

entité message, à la main

parent 770e43ee
<?php
namespace SocketBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* Message
*
* @ORM\Table(name="message")
* @ORM\Entity(repositoryClass="SocketBundle\Repository\MessageRepository")
*/
class Message
{
/**
* @var int
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @var User
* @ORM\ManyToOne(targetEntity="SocketBundle\Entity\User")
* @ORM\JoinColumn(name="id_author", nullable=false)
*/
private $author;
/**
* @var User
* @ORM\ManyToOne(targetEntity="SocketBundle\Entity\User")
* @ORM\JoinColumn(name="id_receiver", nullable=false)
*/
private $receiver;
/**
* @var string
* @ORM\Column(name="content", type="text", nullable=false, unique=false)
*/
private $content;
/**
* @var \DateTime
* @ORM\Column(name="date", type="datetime", nullable=false, unique=false)
*/
private $date;
/**
* Get id
*
* @return int
*/
public function getId()
{
return $this->id;
}
/**
* @return User
*/
public function getAuthor()
{
return $this->author;
}
/**
* @param User $author
* @return Message
*/
public function setAuthor($author)
{
$this->author = $author;
return $this;
}
/**
* @return User
*/
public function getReceiver()
{
return $this->receiver;
}
/**
* @param User $receiver
* @return Message
*/
public function setReceiver($receiver)
{
$this->receiver = $receiver;
return $this;
}
/**
* @return string
*/
public function getContent()
{
return $this->content;
}
/**
* @param string $content
* @return Message
*/
public function setContent($content)
{
$this->content = $content;
return $this;
}
/**
* @return \DateTime
*/
public function getDate()
{
return $this->date;
}
/**
* @param \DateTime $date
* @return Message
*/
public function setDate($date)
{
$this->date = $date;
return $this;
}
}
<?php
namespace SocketBundle\Repository;
/**
* MessageRepository
*
* This class was generated by the Doctrine ORM. Add your own custom
* repository methods below.
*/
class MessageRepository extends \Doctrine\ORM\EntityRepository
{
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment