Verzeichnisstruktur phpBB-3.2.0


Veröffentlicht
06.01.2017

So funktioniert es


Auf das letzte Element klicken. Dies geht jeweils ein Schritt zurück

Auf das Icon klicken, dies öffnet das Verzeichnis. Nochmal klicken schließt das Verzeichnis.
Auf den Verzeichnisnamen klicken, dies zeigt nur das Verzeichnis mit Inhalt an

      (Beispiel Datei-Icons)

Auf das Icon klicken um den Quellcode anzuzeigen

ArrayMapNamingStrategy.php

Zuletzt modifiziert: 09.10.2024, 12:58 - Dateigröße: 1.28 KiB


 01  <?php
 02  /**
 03   * Zend Framework (http://framework.zend.com/)
 04   *
 05   * @link      http://github.com/zendframework/zf2 for the canonical source repository
 06   * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
 07   * @license   http://framework.zend.com/license/new-bsd New BSD License
 08   */
 09   
 10  namespace Zend\Stdlib\Hydrator\NamingStrategy;
 11   
 12  final class ArrayMapNamingStrategy implements NamingStrategyInterface
 13  {
 14      /**
 15       * @var string[]
 16       */
 17      private $extractionMap = array();
 18   
 19      /**
 20       * @var string[]
 21       */
 22      private $hydrationMap = array();
 23   
 24      /**
 25       * Constructor
 26       *
 27       * @param array $extractionMap A map of string keys and values for symmetric translation of hydrated
 28       *                             and extracted field names
 29       */
 30      public function __construct(array $extractionMap)
 31      {
 32          $this->extractionMap = $extractionMap;
 33          $this->hydrationMap  = array_flip($extractionMap);
 34      }
 35   
 36      /**
 37       * {@inheritDoc}
 38       */
 39      public function hydrate($name)
 40      {
 41          return isset($this->hydrationMap[$name]) ? $this->hydrationMap[$name] : $name;
 42      }
 43   
 44      /**
 45       * {@inheritDoc}
 46       */
 47      public function extract($name)
 48      {
 49          return isset($this->extractionMap[$name]) ? $this->extractionMap[$name] : $name;
 50      }
 51  }
 52