2011-01-01 20:17:19 +03:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Doctrine\Tests\Models\DDC117;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @Entity
|
|
|
|
*/
|
|
|
|
class DDC117Reference
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @Id
|
|
|
|
* @ManyToOne(targetEntity="DDC117Article", inversedBy="references")
|
|
|
|
* @JoinColumn(name="source_id", referencedColumnName="article_id")
|
|
|
|
*/
|
|
|
|
private $source;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @Id
|
2012-01-15 14:27:28 +04:00
|
|
|
* @ManyToOne(targetEntity="DDC117Article")
|
2011-01-01 20:17:19 +03:00
|
|
|
* @JoinColumn(name="target_id", referencedColumnName="article_id")
|
|
|
|
*/
|
|
|
|
private $target;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @column(type="string")
|
|
|
|
*/
|
|
|
|
private $description;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @column(type="datetime")
|
|
|
|
*/
|
|
|
|
private $created;
|
|
|
|
|
|
|
|
public function __construct($source, $target, $description)
|
|
|
|
{
|
|
|
|
$source->addReference($this);
|
|
|
|
$target->addReference($this);
|
|
|
|
|
|
|
|
$this->source = $source;
|
|
|
|
$this->target = $target;
|
|
|
|
$this->description = $description;
|
|
|
|
$this->created = new \DateTime("now");
|
|
|
|
}
|
|
|
|
|
|
|
|
public function source()
|
|
|
|
{
|
|
|
|
return $this->source;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function target()
|
|
|
|
{
|
|
|
|
return $this->target;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function setDescription($desc)
|
|
|
|
{
|
|
|
|
$this->description = $desc;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getDescription()
|
|
|
|
{
|
|
|
|
return $this->description;
|
|
|
|
}
|
2012-01-15 14:27:28 +04:00
|
|
|
}
|