ヤミRoot VoidGate
User / IP
:
216.73.216.84
Host / Server
:
146.88.233.70 / dev.loger.cm
System
:
Linux hybrid1120.fr.ns.planethoster.net 3.10.0-957.21.2.el7.x86_64 #1 SMP Wed Jun 5 14:26:44 UTC 2019 x86_64
Command
|
Upload
|
Create
Mass Deface
|
Jumping
|
Symlink
|
Reverse Shell
Ping
|
Port Scan
|
DNS Lookup
|
Whois
|
Header
|
cURL
:
/
home
/
logercm
/
dev.loger.cm
/
src
/
Entity
/
Viewing: MediaObject.php
<?php /** * Created by PhpStorm. * User: user * Date: 02/07/2020 * Time: 10:24 */ namespace App\Entity; use ApiPlatform\Core\Annotation\ApiProperty; use ApiPlatform\Core\Annotation\ApiResource; use App\Controller\CreateMediaObjectAction; use Doctrine\ORM\Mapping as ORM; use Symfony\Component\HttpFoundation\File\File; use Symfony\Component\Serializer\Annotation\Groups; use Symfony\Component\Validator\Constraints as Assert; use Vich\UploaderBundle\Mapping\Annotation as Vich; use App\Repository\MediaObjectRepository; /** * @ORM\Entity * @ApiResource( * iri="http://schema.org/MediaObject", * normalizationContext={ * "groups"={"media_object_read"} * }, * collectionOperations={ * "post"={ * "controller"=CreateMediaObjectAction::class, * "deserialize"=false, * "security"="is_granted('ROLE_USER')", * "validation_groups"={"Default", "media_object_create"}, * "openapi_context"={ * "requestBody"={ * "content"={ * "multipart/form-data"={ * "schema"={ * "type"="object", * "properties"={ * "file"={ * "type"="string", * "format"="binary" * }, * "file_type"={ * "type"="string", * "exemple"="user" * }, * "directory"={ * "type"="string", * "exemple"="user" * }, * } * } * } * } * } * } * }, * "get"= * { * "security"="is_granted('ROLE_USER')", * "validation_groups"={"Default", "media_object_create"}, * } * }, * itemOperations={ * "get" * } * ) * @ORM\Entity(repositoryClass= MediaObjectRepository::class) * @Vich\Uploadable */ class MediaObject { /** * @var int|null * * @ORM\Column(type="integer") * @ORM\GeneratedValue * @ORM\Id * @Groups({"media_object_read"}) */ protected $id; /** * @var string|null * * @ApiProperty(iri="http://schema.org/contentUrl") * @Groups({"media_object_read"}) */ public $contentUrl; /** * @var File|null * * @Assert\NotNull(groups={"media_object_create"}) * @Vich\UploadableField(mapping="media_object", fileNameProperty="filePath", mimeType="image/*") */ public $file; /** * @var string|null * @Groups({"media_object_read"}) * @ORM\Column(nullable=true) */ public $filePath; /** * @ORM\Column(type="datetime", nullable=true) */ private $createdAt; /** * @Assert\NotNull(groups={"media_object_create"}) * @Groups({"media_object_read"}) * @ORM\Column(type="string", length=255, nullable=false) */ private $fileType; /** * @Assert\NotNull(groups={"media_object_create"}) * @Groups({"media_object_read"}) * @ORM\Column(type="string", length=255, nullable=true) */ private $directory; public function getId(): ?int { return $this->id; } public function getFilePath(): ?string { return $this->directory."/".$this->filePath; } public function getCreatedAt(): ?\DateTimeInterface { return $this->createdAt; } public function setCreatedAt(?\DateTimeInterface $createdAt): self { $this->createdAt = $createdAt; return $this; } public function __construct() { $this->createdAt = new \DateTime( ); } public function __toString() { // TODO: Implement __toString() method. return $this->directory."/". $this->filePath; } /** * @return string|null */ public function getContentUrl(): ?string { return $this->contentUrl; } /** * @param string|null $filepath */ public function setFilePath(?string $filepath): void { $this->filePath = $filepath; } public function getFileType(): ?string { return $this->fileType; } public function setFileType(?string $fileType): self { $this->fileType = $fileType; return $this; } public function getDirectory(): ?string { return $this->directory; } public function setDirectory(?string $directory): self { $this->directory = $directory; return $this; } }
Coded With 💗 by
0x6ick