Support Joomla!

Joomla! 1.5 Documentation

Packages

Package: Joomla-Framework

Developer Network License

The Joomla! Developer Network content is © copyright 2006 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution- NonCommercial- ShareAlike 2.5
Source code for file /joomla/registry/format/php.php

Documentation is available at php.php

  1. <?php
  2. /**
  3.  * @version        $Id: php.php 6472 2007-02-03 10:47:26Z pasamio $
  4.  * @package        Joomla.Framework
  5.  * @subpackage    Registry
  6.  * @copyright    Copyright (C) 2005 - 2007 Open Source Matters. All rights reserved.
  7.  * @license        GNU/GPL, see LICENSE.php
  8.  *  Joomla! is free software. This version may have been modified pursuant
  9.  *  to the GNU General Public License, and as distributed it includes or
  10.  *  is derivative of works licensed under the GNU General Public License or
  11.  *  other free or open source software licenses.
  12.  *  See COPYRIGHT.php for copyright notices and details.
  13.  */
  14.  
  15. // Check to ensure this file is within the rest of the framework
  16. defined('JPATH_BASE'or die();
  17.  
  18. /**
  19.  * PHP class format handler for JRegistry
  20.  *
  21.  * @author         Louis Landry <[email protected]>
  22.  * @package     Joomla.Framework
  23.  * @subpackage        Registry
  24.  * @since        1.5
  25.  */
  26.  
  27.     /**
  28.      * Converts an object into a php class string.
  29.      *     - NOTE: Only one depth level is supported.
  30.      *
  31.      * @access public
  32.      * @param object $object Data Source Object
  33.      * @param array  $param  Parameters used by the formatter
  34.      * @return string Config class formatted string
  35.      * @since 1.5
  36.      */
  37.     function objectToString&$object$params {
  38.  
  39.         // Build the object variables string
  40.         $vars '';
  41.         foreach (get_object_vars$object as $k => $v{
  42.             $vars .= "\tvar $"$k " = '" addslashes($v"';\n";
  43.         }
  44.  
  45.         $str "<?php\nclass ".$params['class']." {\n";
  46.         $str .= $vars;
  47.         $str .= "}\n?>";
  48.  
  49.         return $str;
  50.     }
  51.  
  52.     /**
  53.      * Placeholder method
  54.      *
  55.      * @access public
  56.      * @return boolean True
  57.      * @since 1.5
  58.      */
  59.     function stringToObject({
  60.         return true;
  61.     }
  62. }
  63. ?>

Documentation generated on Mon, 05 Mar 2007 21:16:57 +0000 by phpDocumentor 1.3.1