2015-01-24 11:54:03 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Doctrine\Tests\Models\Tweet;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @Entity
|
|
|
|
* @Table(name="tweet_tweet")
|
|
|
|
*/
|
|
|
|
class Tweet
|
|
|
|
{
|
|
|
|
const CLASSNAME = __CLASS__;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @Id
|
|
|
|
* @GeneratedValue
|
|
|
|
* @Column(type="integer")
|
|
|
|
*/
|
|
|
|
public $id;
|
|
|
|
|
|
|
|
/**
|
2015-01-29 18:39:30 +00:00
|
|
|
* @Column(type="string", length=140)
|
2015-01-24 11:54:03 +01:00
|
|
|
*/
|
2015-01-29 18:39:30 +00:00
|
|
|
public $content = '';
|
2015-01-24 11:54:03 +01:00
|
|
|
|
|
|
|
/**
|
2015-01-29 18:39:30 +00:00
|
|
|
* @ManyToOne(targetEntity="User", inversedBy="tweets", cascade={"persist"}, fetch="EXTRA_LAZY")
|
2015-01-24 11:54:03 +01:00
|
|
|
*/
|
|
|
|
public $author;
|
|
|
|
|
2015-01-29 18:39:30 +00:00
|
|
|
/**
|
|
|
|
* @param User $author
|
|
|
|
*/
|
|
|
|
public function setAuthor(User $author)
|
2015-01-24 11:54:03 +01:00
|
|
|
{
|
2015-02-05 00:11:19 +00:00
|
|
|
$this->author = $author;
|
2015-01-24 11:54:03 +01:00
|
|
|
}
|
|
|
|
}
|