diff --git a/app/config/filters.yml b/app/config/filters.yml index cc66af6..641bbad 100644 --- a/app/config/filters.yml +++ b/app/config/filters.yml @@ -18,3 +18,8 @@ services: parent: 'api_platform.doctrine.orm.search_filter' arguments: [ { video: 'exact' } ] tags: [ { name: 'api_platform.filter', id: 'view.search' } ] + + metadata.search_filter: + parent: 'api_platform.doctrine.orm.search_filter' + arguments: [ { location: 'exact' } ] + tags: [ { name: 'api_platform.filter', id: 'metadata.search' } ] \ No newline at end of file diff --git a/src/AppBundle/Entity/Location.php b/src/AppBundle/Entity/Location.php new file mode 100644 index 0000000..58bb552 --- /dev/null +++ b/src/AppBundle/Entity/Location.php @@ -0,0 +1,91 @@ +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; + } + +} \ No newline at end of file diff --git a/src/AppBundle/Entity/Metadata.php b/src/AppBundle/Entity/Metadata.php index 5f8a6b9..ad680b5 100644 --- a/src/AppBundle/Entity/Metadata.php +++ b/src/AppBundle/Entity/Metadata.php @@ -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() + { + return $this->location; + } + + public function setLocation(string $location): Metadata + { + $this->location = $location; + + return $this; + } + }