Skip to content
Snippets Groups Projects
Commit ea4df2a7 authored by Robert Lange's avatar Robert Lange
Browse files

refs #21064 [fid] RecordTab and Serializer: add comments

parent c4b0109a
No related merge requests found
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category VuFind * @category VuFind
* @package RecordTabs * @package RecordTab
* @author Demian Katz <demian.katz@villanova.edu> * @author Demian Katz <demian.katz@villanova.edu>
* @author André Lahmann <lahmann@ub.uni-leipzig.de> * @author André Lahmann <lahmann@ub.uni-leipzig.de>
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License
...@@ -32,7 +32,7 @@ namespace fid\RecordTab; ...@@ -32,7 +32,7 @@ namespace fid\RecordTab;
* Staff view tab for AI records * Staff view tab for AI records
* *
* @category VuFind * @category VuFind
* @package RecordTabs * @package RecordTab
* @author Demian Katz <demian.katz@villanova.edu> * @author Demian Katz <demian.katz@villanova.edu>
* @author Gregor Gawol <gawol@ub.uni-leipzig.de> * @author Gregor Gawol <gawol@ub.uni-leipzig.de>
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License
...@@ -65,7 +65,11 @@ class Worldcat extends \VuFind\RecordTab\AbstractBase ...@@ -65,7 +65,11 @@ class Worldcat extends \VuFind\RecordTab\AbstractBase
*/ */
public function isActive() public function isActive()
{ {
if (!$this->getRecordDriver()->tryMethod('hasRecordPermission', [$this->accessPermission])) { $hasRecordPermission = $this->getRecordDriver()->tryMethod(
'hasRecordPermission',
[$this->accessPermission]
);
if (!$hasRecordPermission) {
return false; return false;
} }
$oclc = $this->getRecordDriver()->tryMethod('getOCLC'); $oclc = $this->getRecordDriver()->tryMethod('getOCLC');
......
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
/** /**
* Copyright (C) 2019 Leipzig University Library * Copyright (C) 2019 Leipzig University Library
* *
* PHP Version 7
*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as * it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation. * published by the Free Software Foundation.
...@@ -15,9 +17,15 @@ ...@@ -15,9 +17,15 @@
* with this program; if not, write to the Free Software Foundation, Inc., * with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* @author Gregor Gawol <gawol@ub.uni-leipzig.de> * Serializer for Order Requests to FIDIS API
* @author Sebastian Kehr <kehr@ub.uni-leipzig.de> * https://git.sc.uni-leipzig.de/ubl/finc/fid/fidis/-/blob/master/bundle/Entity/Order.php
* @license http://opensource.org/licenses/gpl-2.0.php GNU GPLv2 *
* @category VuFind
* @package Serializer
* @author Gregor Gawol <gawol@ub.uni-leipzig.de>
* @author Sebastian Kehr <kehr@ub.uni-leipzig.de>
* @license http://opensource.org/licenses/gpl-2.0.php GNU GPLv2
* @link https://vufind.org/wiki/development Wiki
*/ */
namespace fid\Serializer; namespace fid\Serializer;
...@@ -26,11 +34,33 @@ use Symfony\Component\Serializer\Normalizer\ContextAwareNormalizerInterface; ...@@ -26,11 +34,33 @@ use Symfony\Component\Serializer\Normalizer\ContextAwareNormalizerInterface;
use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface;
use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait;
/**
* Class OrderCreationRequestUserNormalizer
*
* Serializer for Order Requests to FIDIS API
* https://git.sc.uni-leipzig.de/ubl/finc/fid/fidis/-/blob/master/bundle/Entity/Order.php
*
* @category VuFind
* @package Serializer
* @author Gregor Gawol <gawol@ub.uni-leipzig.de>
* @author Sebastian Kehr <kehr@ub.uni-leipzig.de>
* @license http://opensource.org/licenses/gpl-2.0.php GNU GPLv2
* @link https://vufind.org/wiki/development Wiki
*/
class OrderCreationRequestUserNormalizer implements class OrderCreationRequestUserNormalizer implements
ContextAwareNormalizerInterface, NormalizerAwareInterface ContextAwareNormalizerInterface, NormalizerAwareInterface
{ {
use NormalizerAwareTrait; use NormalizerAwareTrait;
/**
* {@inheritdoc}
*
* @param mixed $data Order data
* @param null $format Format the normalization result will be encoded as
* @param array $context Context options for the normalizer
*
* @return bool true if Serializer supports normalization otherwise false
*/
public function supportsNormalization( public function supportsNormalization(
$data, $data,
$format = null, $format = null,
...@@ -41,9 +71,11 @@ class OrderCreationRequestUserNormalizer implements ...@@ -41,9 +71,11 @@ class OrderCreationRequestUserNormalizer implements
} }
/** /**
* @param mixed|User $object * {@inheritdoc}
* @param null $format *
* @param array $context * @param mixed|User $object Object to normalize
* @param null $format Format the normalization result will be encoded as
* @param array $context Context options for the normalizer
* *
* @return array|bool|float|int|string * @return array|bool|float|int|string
*/ */
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment