From 552bb88d4eba05e15ec03f55c8014f706958c38d Mon Sep 17 00:00:00 2001 From: Nicolas Le Goff Date: Tue, 2 Dec 2014 16:35:50 +0100 Subject: [PATCH] Add exif method to record interface --- lib/Alchemy/Phrasea/Model/RecordInterface.php | 3 +++ lib/classes/record/adapter.php | 9 +++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/Alchemy/Phrasea/Model/RecordInterface.php b/lib/Alchemy/Phrasea/Model/RecordInterface.php index 317dcec742..f964fa7603 100644 --- a/lib/Alchemy/Phrasea/Model/RecordInterface.php +++ b/lib/Alchemy/Phrasea/Model/RecordInterface.php @@ -57,4 +57,7 @@ interface RecordInterface /** @return string */ public function getStatus(); + + /** @return ArrayCollection */ + public function getExif(); } diff --git a/lib/classes/record/adapter.php b/lib/classes/record/adapter.php index fd316b6db7..c1f91d6caa 100644 --- a/lib/classes/record/adapter.php +++ b/lib/classes/record/adapter.php @@ -18,6 +18,7 @@ use Alchemy\Phrasea\Model\Serializer\CaptionSerializer; use Alchemy\Phrasea\SearchEngine\SearchEngineInterface; use Alchemy\Phrasea\SearchEngine\SearchEngineOptions; use Doctrine\ORM\EntityManager; +use Doctrine\Common\Collections\ArrayCollection; use MediaVorus\MediaVorus; use Rhumsaa\Uuid\Uuid; use Alchemy\Phrasea\Model\RecordInterface; @@ -740,7 +741,6 @@ class record_adapter implements RecordInterface, cache_cacheableInterface */ public function get_technical_infos($data = false) { - if (!$this->technical_datas) { try { $this->technical_datas = $this->get_data_from_cache(self::CACHE_TECHNICAL_DATAS); @@ -1907,7 +1907,6 @@ class record_adapter implements RecordInterface, cache_cacheableInterface return $this->get_type(); } - /** {@inheritdoc} */ public function getUpdated() { @@ -1936,4 +1935,10 @@ class record_adapter implements RecordInterface, cache_cacheableInterface { return $this->get_status(); } + + /** {@inheritdoc} */ + public function getExif() + { + return new ArrayCollection($this->get_technical_infos()); + } }