One Hat Cyber Team
Your IP :
216.73.216.14
Server IP :
194.44.31.54
Server :
Linux zen.imath.kiev.ua 4.18.0-553.77.1.el8_10.x86_64 #1 SMP Fri Oct 3 14:30:23 UTC 2025 x86_64
Server Software :
Apache/2.4.37 (Rocky Linux) OpenSSL/1.1.1k
PHP Version :
5.6.40
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
var
/
www
/
ojs-nosc
/
lib
/
pkp
/
classes
/
section
/
maps
/
Edit File:
Schema.php
<?php /** * @file classes/section/maps/Schema.php * * Copyright (c) 2014-2023 Simon Fraser University * Copyright (c) 2003-2023 John Willinsky * Distributed under the GNU GPL v3. For full terms see the file docs/COPYING. * * @class Schema * * @brief Map sections to the properties defined in the section schema */ namespace PKP\section\maps; use APP\section\Section; use Illuminate\Support\Enumerable; use PKP\services\PKPSchemaService; class Schema extends \PKP\core\maps\Schema { /** @copydoc \PKP\core\maps\Schema::$collection */ public Enumerable $collection; /** @copydoc \PKP\core\maps\Schema::$schema */ public string $schema = PKPSchemaService::SCHEMA_SECTION; /** * Map a section * * Includes all properties in the section schema. */ public function map(Section $item): array { return $this->mapByProperties($this->getProps(), $item); } /** * Summarize an section * * Includes properties with the apiSummary flag in the section schema. */ public function summarize(Section $item): array { return $this->mapByProperties($this->getSummaryProps(), $item); } /** * Map a collection of Sections * * @see self::map */ public function mapMany(Enumerable $collection): Enumerable { $this->collection = $collection; return $collection->map(function ($item) { return $this->map($item); }); } /** * Summarize a collection of Sections * * @see self::summarize */ public function summarizeMany(Enumerable $collection): Enumerable { $this->collection = $collection; return $collection->map(function ($item) { return $this->summarize($item); }); } /** * Map schema properties of an Section to an assoc array */ protected function mapByProperties(array $props, Section $item): array { $output = []; foreach ($props as $prop) { switch ($prop) { case '_href': $output[$prop] = $this->getApiUrl('sections/' . $item->getId()); break; default: $output[$prop] = $item->getData($prop); break; } } $output = $this->schemaService->addMissingMultilingualValues($this->schema, $output, $this->context->getSupportedFormLocales()); ksort($output); return $this->withExtensions($output, $item); } }
Simpan