Location: PHPKode > projects > PWF > PWF_0.3.0/Type/Object.php
<?php
/**
 * _Type_Object is the parent of object in model of a PWF project 
 * @copyright	Copyright (c) 2012, PWF
 * @license		http://phpwebframework.com/License 
 * @version PWF_0.3.0
 */
class _Type_Object
{

  /**
   * Returns an array with keys the properties names of the object and value their value 
   * @return array
   */
  public function toArray()
  {
    $a = (array)$this;
    $r = array();
    foreach(array_keys($a) as $key)
    {
      $b = explode(chr(0),$key);
      $r[$b[count($b)-1]]=$a[$key];
    }
    return $r;
  }

  /**
   * Return if the given property name exists in the object
   * @param string $propertyName
   * @return boolean
   */
  public function propertyExist($propertyName)
  {
    return property_exists($this, $propertyName);
  }

  /**
   * Return if the object has the given method name.
   * @param string $methodName
   * @return boolean
   */
  public function methodExist($methodName)
  {
    return method_exists($this, $methodName);
  }
}
?>
Return current item: PWF