本文整理匯總了PHP中form_edit_site_object_action::_update_object_operation方法的典型用法代碼示例。如果您正苦於以下問題:PHP form_edit_site_object_action::_update_object_operation方法的具體用法?PHP form_edit_site_object_action::_update_object_operation怎麽用?PHP form_edit_site_object_action::_update_object_operation使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類form_edit_site_object_action
的用法示例。
在下文中一共展示了form_edit_site_object_action::_update_object_operation方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1:
function _update_object_operation()
{
if ($file = $this->dataspace->get('file')) {
$object_data =& fetch_requested_object();
$this->object->set_attribute('media_id', $object_data['media_id']);
$this->object->set_attribute('tmp_file_path', $file['tmp_name']);
$this->object->set_attribute('file_name', $file['name']);
$this->object->set_attribute('mime_type', $file['type']);
}
return parent::_update_object_operation();
}
示例2:
function _update_object_operation(&$object)
{
if (isset($_FILES[$this->name]['tmp_name']['file'])) {
if ($_FILES[$this->name]['size']['file'] > ini_get('upload_max_filesize') * 1024 * 1024) {
message_box::write_warning('uploaded file size exceeds limit');
return false;
}
$object_data =& fetch_mapped_by_url();
$object->set_attribute('media_id', $object_data['media_id']);
$object->set_attribute('tmp_file_path', $_FILES[$this->name]['tmp_name']['file']);
$object->set_attribute('file_name', $_FILES[$this->name]['name']['file']);
$object->set_attribute('mime_type', $_FILES[$this->name]['type']['file']);
}
return parent::_update_object_operation(&$object);
}