-
Notifications
You must be signed in to change notification settings - Fork 0
Add metadata location #23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,91 @@ | ||
| <?php | ||
|
|
||
|
|
||
| namespace AppBundle\Entity; | ||
|
|
||
| use Doctrine\ORM\Mapping as ORM; | ||
| use Symfony\Component\Validator\Constraints as Assert; | ||
|
|
||
| /** | ||
| * Class Location. | ||
| * | ||
| * @ORM\Entity | ||
| */ | ||
| class Location | ||
| { | ||
|
|
||
| /** | ||
| * | ||
| * | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove the two empty lines |
||
| * @ORM\Column(type="decimal", scale="8") | ||
| * @Assert\NotBlank() | ||
| */ | ||
| protected $latitude; | ||
|
|
||
|
|
||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove one blank line |
||
| /** | ||
| * | ||
| * | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove the two blank lines |
||
| * @ORM\Column(type="decimal", scale="8") | ||
| * @Assert\NotBlank() | ||
| */ | ||
| protected $longitude; | ||
|
|
||
|
|
||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove the blank line |
||
| /** | ||
| * @var Metadata | ||
| * | ||
| * @ORM\OneToMany(targetEntity="AppBundle\Entity\Metadata", mappedBy="location", cascade={"persist"}) | ||
| * @Groups({"video"}) | ||
| */ | ||
| private $metadata; | ||
|
|
||
| /** | ||
| * @return Metadata | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please remove all the annotation blocks from the methods |
||
| */ | ||
| public function getMetadata(): Metadata | ||
| { | ||
| return $this->metadata; | ||
| } | ||
|
|
||
| /** | ||
| * @param Metadata $metadata | ||
| */ | ||
| public function setMetadata(Metadata $metadata) | ||
| { | ||
| $this->metadata = $metadata; | ||
| } | ||
|
|
||
| /** | ||
| * @return mixed | ||
| */ | ||
| public function getLatitude() | ||
| { | ||
| return $this->latitude; | ||
| } | ||
|
|
||
| /** | ||
| * @param mixed $latitude | ||
| */ | ||
| public function setLatitude($latitude) | ||
| { | ||
| $this->latitude = $latitude; | ||
| } | ||
|
|
||
| /** | ||
| * @return mixed | ||
| */ | ||
| public function getLongitude() | ||
| { | ||
| return $this->longitude; | ||
| } | ||
|
|
||
| /** | ||
| * @param mixed $longitude | ||
| */ | ||
| public function setLongitude($longitude) | ||
| { | ||
| $this->longitude = $longitude; | ||
| } | ||
|
|
||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove the blank line |
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,7 +11,7 @@ | |
| * Metadata. | ||
| * | ||
| * @ORM\Entity | ||
| * @ApiResource | ||
| * @ApiResource(attributes={"filters" = {"metadata.search"}}) | ||
| */ | ||
| class Metadata | ||
| { | ||
|
|
@@ -56,6 +56,14 @@ class Metadata | |
| */ | ||
| private $format; | ||
|
|
||
| /** | ||
| * @var location | ||
| * | ||
| * @ORM\ManyToOne(targetEntity="AppBundle\Entity\Location", inversedBy="matadata") | ||
| * @Groups({"video"}) | ||
| */ | ||
| private $location; | ||
|
|
||
| public function getId(): int | ||
| { | ||
| return $this->id; | ||
|
|
@@ -103,4 +111,17 @@ public function setFormat(string $format): Metadata | |
|
|
||
| return $this; | ||
| } | ||
|
|
||
| public function getLocation() | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Return type is missing (here it should be |
||
| { | ||
| return $this->location; | ||
| } | ||
|
|
||
| public function setLocation(string $location): Metadata | ||
| { | ||
| $this->location = $location; | ||
|
|
||
| return $this; | ||
| } | ||
|
|
||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the blank line