本文整理汇总了PHP中PHPWS_Core::stripObjValues方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPWS_Core::stripObjValues方法的具体用法?PHP PHPWS_Core::stripObjValues怎么用?PHP PHPWS_Core::stripObjValues使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PHPWS_Core
的用法示例。
在下文中一共展示了PHPWS_Core::stripObjValues方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: approveSuggestion
public function approveSuggestion($id)
{
if (!Current_User::authorized('calendar', 'edit_public') || Current_User::isRestricted('calendar')) {
PHPWS_Core::errorPage('403');
}
PHPWS_Core::initModClass('calendar', 'Suggestion.php');
$suggestion = new Calendar_Suggestion((int) $id);
if (!$suggestion->id) {
PHPWS_Core::errorPage('404');
}
$values = PHPWS_Core::stripObjValues($suggestion);
unset($values['id']);
$event = new Calendar_Event();
$event->loadSchedule($suggestion->schedule_id);
$event->public = 1;
PHPWS_Core::plugObject($event, $values);
$result = $event->save();
if (PHPWS_Error::isError($result)) {
PHPWS_Error::log($result);
return false;
}
$suggestion->delete();
}
示例2: createReport
function createReport()
{
if ($this->class) {
$methods = get_class_methods($this->class);
if (in_array($this->report_row, $methods)) {
$func_type = 'method';
}
}
if (!isset($func_type)) {
if (function_exists($this->report_row)) {
$func_type = 'function';
} else {
$func_type = 'none';
}
}
$index_set = false;
$tmp_file = \PHPWS_Text::randomString(10) . time();
$directory = CACHE_DIRECTORY;
$file_path = sprintf('%s/%s', $directory, $tmp_file);
$fp = fopen($file_path, 'w');
foreach ($this->display_rows as $foo) {
if ($func_type == 'method') {
$result = call_user_func(array($foo, $this->report_row));
} elseif ($func_type == 'function') {
$result = call_user_func($this->report_row, $foo);
} else {
if (is_object($foo)) {
$result = PHPWS_Core::stripObjValues($foo);
} else {
$result =& $foo;
}
}
if (!$index_set) {
$index_keys = array_keys($result);
$row = fputcsv($fp, $index_keys);
$index_set = true;
}
fputcsv($fp, $result);
//$row = self::formatCSVRow($result);
//fwrite($fp, $row);
}
fclose($fp);
$new_file = time() . '_pager.csv';
require_once 'HTTP/Download.php';
$dl = new HTTP_Download();
$dl->setFile($file_path);
$dl->setContentDisposition(HTTP_DOWNLOAD_ATTACHMENT, $new_file);
$dl->setContentType('text/csv');
$dl->send();
exit;
}
示例3: saveSettings
public function saveSettings()
{
$db = new PHPWS_DB('layout_config');
$vars = PHPWS_Core::stripObjValues($this);
unset($vars['current_theme']);
unset($vars['_contentVars']);
unset($vars['_boxes']);
unset($vars['_box_order']);
unset($vars['_move_box']);
unset($vars['_theme_variables']);
unset($vars['_default_box']);
unset($vars['_style_sheets']);
unset($vars['_extra_styles']);
unset($vars['_key_styles']);
unset($vars['_allowed_move']);
$db->addValue($vars);
return $db->update();
}
示例4: plugIn
/**
* Accepts an associative array or object. Looks for form elements with the
* same names as the variables in the object or the keys in the array. If
* matching elements are found, their value, match, or checked parameters
* are set based upon the element type.
*/
public function plugIn($values)
{
if (is_object($values)) {
$aVal = PHPWS_Core::stripObjValues($values);
} else {
$aVal =& $values;
}
if (empty($aVal) || !is_array($aVal)) {
return false;
}
foreach ($aVal as $name => $element) {
if (!isset($this->types[$name])) {
continue;
}
$element_type = $this->types[$name];
if (!empty($element_type)) {
switch ($element_type) {
case 'hidden':
case 'text':
case 'textarea':
case 'submit':
case 'button':
$this->setValue($name, $element);
break;
case 'select':
case 'multiple':
case 'radio':
case 'check':
$this->setMatch($name, $element);
break;
}
}
}
}