You are here

function cmfcClassesCore::propertiesToArray in Calendar Systems 5

File

calendar/lib/classesCore.class.inc.php, line 174

Class

cmfcClassesCore
all cmf classes inherit from this class

Code

function propertiesToArray($exceptNulls = false, $prefix = null) {
  $propertiesValues = array();
  if ($this->_dynamicSystemEnabled) {
    $vars = get_object_vars($this);
    foreach ($vars as $varName => $varValue) {
      if (preg_match('/^' . $prefix . '.*/', $varName) or is_null($prefix)) {
        $propertiesValues[$varName] = $varValue;
      }
    }
  }
  else {

    // only for sample :

    /*
    if ($exceptNulls==false or ($exceptNulls and !is_null($this->cvId)))
    	$propertiesValues[$this->colnId]=$this->cvId;
    */
  }
  return $propertiesValues;
}