Location: PHPKode > projects > PIMF > gjerokrsteski-pimf-6b28215/core/Pimf/Param.php
<?php
/**
 * Pimf
 *
 * PHP Version 5
 *
 * LICENSE
 *
 * This source file is subject to the new BSD license that is bundled
 * with this package in the file LICENSE.
 * It is also available through the world-wide-web at this URL:
 * http://krsteski.de/new-bsd-license/
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to hide@address.com so we can send you a copy immediately.
 *
 * @copyright Copyright (c) 2010-2011 Gjero Krsteski (http://krsteski.de)
 * @license http://krsteski.de/new-bsd-license New BSD License
 */

/**
 * @package Pimf
 * @author Gjero Krsteski <hide@address.com>
 */
class Pimf_Param
{
  /**
   * @var ArrayObject
   */
  protected $data = null;

  /**
   * @param array $data
   */
  public function __construct(array $data = array())
  {
    $this->data = new ArrayObject($data, ArrayObject::STD_PROP_LIST);
  }

  /**
   * @return array
   */
  public function getAll()
  {
    return $this->data->getArrayCopy();
  }

  /**
   * @param string $index
   * @param null $defaultValue
   * @return mixed|null
   */
  public function getParam($index, $defaultValue = null)
  {
    if($this->data->offsetExists($index)) {
      return $this->data->offsetGet($index);
    }

    return $defaultValue;
  }
}
Return current item: PIMF