/** * Recursively copy an array, used by deepCopy * * @param array, the input array. * @return array, a deep copy of the input array * @access private * @since 7/12/05 * @static */ function &_deepCopyArray(&$array) { $newArray = array(); foreach (array_keys($array) as $key) { // Use deep-copy if we can on Objects if (is_object($array[$key]) && method_exists($array[$key], 'deepCopy')) { $newArray[$key] =& $array[$key]->deepCopy(); } else { if (is_array($array[$key])) { $newArray[$key] =& SObject::_deepCopyArray($array[$key]); } else { $newArray[$key] = $array[$key]; } } } return $newArray; }
/** * Overriding printablestring * * @return string * @access public * @since 7/12/05 */ function printableString() { $string = parent::printableString(); return $string . '(' . $this->numberOfLegs . ' legs)'; }