You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
156 lines
2.8 KiB
156 lines
2.8 KiB
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
/* For licensing terms, see /license.txt */
|
|
|
|
namespace Chamilo\CoreBundle\Entity;
|
|
|
|
use Doctrine\ORM\Mapping as ORM;
|
|
|
|
/**
|
|
* MessageAttachment.
|
|
*
|
|
* @ORM\Table(name="message_attachment")
|
|
* @ORM\Entity
|
|
*/
|
|
class MessageAttachment extends AbstractResource implements ResourceInterface
|
|
{
|
|
/**
|
|
* @ORM\Column(name="id", type="integer")
|
|
* @ORM\Id
|
|
* @ORM\GeneratedValue(strategy="IDENTITY")
|
|
*/
|
|
protected int $id;
|
|
|
|
/**
|
|
* @ORM\Column(name="path", type="string", length=255, nullable=false)
|
|
*/
|
|
protected string $path;
|
|
|
|
/**
|
|
* @ORM\Column(name="comment", type="text", nullable=true)
|
|
*/
|
|
protected ?string $comment = null;
|
|
|
|
/**
|
|
* @ORM\Column(name="size", type="integer", nullable=false)
|
|
*/
|
|
protected int $size;
|
|
|
|
/**
|
|
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\Message", inversedBy="attachments")
|
|
* @ORM\JoinColumn(name="message_id", referencedColumnName="id", nullable=false)
|
|
*/
|
|
protected Message $message;
|
|
|
|
/**
|
|
* @ORM\Column(name="filename", type="string", length=255, nullable=false)
|
|
*/
|
|
protected string $filename;
|
|
|
|
public function __toString(): string
|
|
{
|
|
return $this->getFilename();
|
|
}
|
|
|
|
public function setPath(string $path): self
|
|
{
|
|
$this->path = $path;
|
|
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* Get path.
|
|
*
|
|
* @return string
|
|
*/
|
|
public function getPath()
|
|
{
|
|
return $this->path;
|
|
}
|
|
|
|
public function setComment(string $comment): self
|
|
{
|
|
$this->comment = $comment;
|
|
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* Get comment.
|
|
*
|
|
* @return string
|
|
*/
|
|
public function getComment()
|
|
{
|
|
return $this->comment;
|
|
}
|
|
|
|
public function setSize(int $size): self
|
|
{
|
|
$this->size = $size;
|
|
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* Get size.
|
|
*
|
|
* @return int
|
|
*/
|
|
public function getSize()
|
|
{
|
|
return $this->size;
|
|
}
|
|
|
|
public function setMessage(Message $message): self
|
|
{
|
|
$this->message = $message;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getMessage(): Message
|
|
{
|
|
return $this->message;
|
|
}
|
|
|
|
public function setFilename(string $filename): self
|
|
{
|
|
$this->filename = $filename;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getFilename(): string
|
|
{
|
|
return $this->filename;
|
|
}
|
|
|
|
/**
|
|
* Get id.
|
|
*
|
|
* @return int
|
|
*/
|
|
public function getId()
|
|
{
|
|
return $this->id;
|
|
}
|
|
|
|
public function getResourceIdentifier(): int
|
|
{
|
|
return $this->getId();
|
|
}
|
|
|
|
public function getResourceName(): string
|
|
{
|
|
return $this->getFilename();
|
|
}
|
|
|
|
public function setResourceName(string $name): self
|
|
{
|
|
return $this->setFilename($name);
|
|
}
|
|
}
|
|
|